问题 脚本试图挂载不存在的 ccxt/async_support/okx.py

This commit is contained in:
zhangkun9038@dingtalk.com 2026-02-22 01:27:54 +08:00
parent 9731c33fff
commit 0b5c56d519

View File

@ -51,8 +51,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[@]}"
@ -349,11 +362,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 \