fix: 将pair_whitelist放在exchange字段中,符合freqtrade配置规范
This commit is contained in:
parent
d5594dcbf4
commit
a75a10074a
@ -32,11 +32,11 @@
|
||||
"enableRateLimit": true,
|
||||
"rateLimit": 500,
|
||||
"timeout": 20000
|
||||
}
|
||||
},
|
||||
"pair_whitelist": [
|
||||
"BTC/USDT"
|
||||
]
|
||||
},
|
||||
"pair_whitelist": [
|
||||
"BTC/USDT"
|
||||
],
|
||||
"pairlists": [
|
||||
{
|
||||
"method": "StaticPairList"
|
||||
|
||||
16
dryrun.sh
16
dryrun.sh
@ -176,18 +176,12 @@ with open(config_path, 'r') as f:
|
||||
# 解析 --pairs 参数中的币对(以空格分隔)
|
||||
pairs = "$PAIRS_ARG".split()
|
||||
|
||||
# 更新 pair_whitelist
|
||||
if 'pair_whitelist' in config:
|
||||
config['pair_whitelist'] = pairs
|
||||
print(f"Updated pair_whitelist to: {pairs}")
|
||||
else:
|
||||
config['pair_whitelist'] = pairs
|
||||
print(f"Added pair_whitelist: {pairs}")
|
||||
# 更新 exchange 字段中的 pair_whitelist
|
||||
if 'exchange' not in config:
|
||||
config['exchange'] = {}
|
||||
|
||||
# 重要: 只在临时配置中保留 pair_whitelist,不包含 pairlists
|
||||
# 这样可以避免 pairlists 被覆盖
|
||||
# 我们需要清除 config 中除了 pair_whitelist 之外的所有字段
|
||||
clean_config = {'pair_whitelist': config['pair_whitelist']}
|
||||
config['exchange']['pair_whitelist'] = pairs
|
||||
print(f"Updated exchange.pair_whitelist to: {pairs}")
|
||||
|
||||
# 写入临时配置文件
|
||||
with open('$TEMP_CONFIG', 'w') as f:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user