backtest.sh 不再写死用哪个策略,为了适配不同分支下的不同策略

This commit is contained in:
zhangkun9038@dingtalk.com 2025-05-14 04:33:27 +00:00
parent 114a0b584d
commit ff26d32726

View File

@ -1,5 +1,11 @@
#!/bin/bash
# 设置默认值
STRATEGY_NAME=${STRATEGY_NAME:-TheForceV7}
CONFIG_FILE=${CONFIG_FILE:-basic.json}
echo "Using strategy: $STRATEGY_NAME"
echo "Using config: $CONFIG_FILE"
# Parse command line arguments
START_DATE=${1:-$(date -d "2 days ago" +"%Y%m%d")}
END_DATE=${2:-$(date -d "tomorrow" +"%Y%m%d")}
@ -14,9 +20,9 @@ rm -fr ./user_data/dryrun_results/*
freqtrade backtesting \
--logfile ./user_data/logs/freqtrade.log \
--freqaimodel XGBoostRegressor \
--config config_examples/theforcev7.json \
--strategy $STRATEGY_NAME \
--config $CONFIG_FILE \
--strategy-path ./freqtrade/templates \
--strategy TheForceV7 \
--timerange ${START_DATE}-${END_DATE} \
--breakdown week month \
--export trades \