From e69e7624eafb827beca07416d1e9b3cd5f32f5df Mon Sep 17 00:00:00 2001 From: "zhangkun9038@dingtalk.com" Date: Sun, 22 Feb 2026 01:30:13 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=AF=95=E5=9B=BE=E6=8C=82=E8=BD=BD=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=20ccxt/async=5Fsupport/okx.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/dryrun.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/dryrun.sh b/tools/dryrun.sh index 3716963d..4301d711 100755 --- a/tools/dryrun.sh +++ b/tools/dryrun.sh @@ -15,8 +15,21 @@ get_open_trades_pairs() { return fi - local query_result=$(sqlite3 -header -csv "$db_path" "SELECT id, pair, open_date, amount, open_rate, max_rate, close_profit, stake_amount FROM trades WHERE is_open = 1 ORDER BY open_date DESC LIMIT 10;") - pairs=($(echo "$query_result" | awk -F ',' 'NR > 1 {print $2}' | tr -d '"')) + local query_result=$(python3 -c " +import sqlite3 +import sys +db_path = sys.argv[1] +try: + conn = sqlite3.connect(db_path) + cursor = conn.cursor() + cursor.execute('SELECT pair FROM trades WHERE is_open = 1 ORDER BY open_date DESC LIMIT 10') + pairs = [row[0] for row in cursor.fetchall()] + print(' '.join(pairs)) + conn.close() +except Exception as e: + print('') +" "$db_path") + pairs=($query_result) echo "从数据库获取到开放交易对: ${pairs[*]}" >&2 echo "${pairs[@]}" @@ -293,11 +306,6 @@ docker run -d --restart=always \ -v "$(pwd)/../config_examples:/freqtrade/config_examples" \ -v "$(pwd)/../freqtrade/templates:/freqtrade/templates" \ -v "$(pwd)/../freqtrade/exchange:/freqtrade/exchange" \ - -v "$(pwd)/../freqtrade/plugins/protections:/freqtrade/freqtrade/plugins/protections" \ - -v "$(pwd)/../ccxt/async_support/okx.py:/home/ftuser/.local/lib/python3.12/site-packages/ccxt/async_support/okx.py" \ - -v "$(pwd)/../freqtrade/freqai/data_kitchen.py:/freqtrade/freqai/data_kitchen.py" \ - -v "$(pwd)/../freqtrade/freqai/data_drawer.py:/freqtrade/freqai/data_drawer.py" \ - -v "$(pwd)/../freqtrade/freqai/freqai_interface.py:/freqtrade/freqai/freqai_interface.py" \ freqtradeorg/freqtrade:develop_freqai_withredis \ trade \ --logfile /freqtrade/user_data/logs/freqtrade.log \