diff --git a/config_examples/dryrun.json b/config_examples/dryrun.json index 2ff3d056..54fe8c49 100644 --- a/config_examples/dryrun.json +++ b/config_examples/dryrun.json @@ -78,7 +78,66 @@ "price_side": "other", "use_order_book": false }, - + "freqai": { + "enabled": true, + "data_kitchen": { + "fillna": "ffill" + }, + "freqaimodel": "LightGBMMultiTargetRegressor", + "purge_old_models": 2, + "identifier": "dryrun-freqai", + "train_period_days": 18, + "backtest_period_days": 2, + "live_retrain_hours": 2, + "outlier_detection": { + "method": "IsolationForest", + "contamination": 0.1 + }, + "feature_selection": { + "method": "recursive_elimination" + }, + "feature_parameters": { + "include_timeframes": [ + "3m", + "15m", + "1h", + "4h" + ], + "include_corr_pairlist": [ + "ETH/USDT", + "SOL/USDT" + ], + "outlier_protection_percentage": 0.1, + "label_period_candles": 100, + "include_shifted_candles": 3, + "DI_threshold": 0.5, + "weight_factor": 0.9, + "principal_component_analysis": false, + "use_SVM_to_remove_outliers": true, + "indicator_periods_candles": [ + 10, + 20, + 50, + 100 + ], + "plot_feature_importances": 10 + }, + "data_split_parameters": { + "test_size": 0.15, + "shuffle": false + }, + "model_training_parameters": { + "n_estimators": 1000, + "learning_rate": 0.015, + "num_leaves": 60, + "max_depth": 15, + "min_data_in_leaf": 10, + "feature_fraction": 0.8, + "bagging_fraction": 0.8, + "bagging_freq": 5, + "verbose": -1 + } + }, "fee": 0.0008, "api_server": { "enabled": true, diff --git a/config_examples/freqaiprimer.json b/config_examples/freqaiprimer.json index 2aec6841..24d8fa16 100644 --- a/config_examples/freqaiprimer.json +++ b/config_examples/freqaiprimer.json @@ -75,7 +75,6 @@ }, "freqaimodel": "LightGBMMultiTargetRegressor", "purge_old_models": 2, - "identifier": "test58", "train_period_days": 12, "backtest_period_days": 2, "live_retrain_hours": 2, diff --git a/config_examples/live.json b/config_examples/live.json index 325472e5..102cdb74 100644 --- a/config_examples/live.json +++ b/config_examples/live.json @@ -91,7 +91,7 @@ }, "freqaimodel": "LightGBMMultiTargetRegressor", "purge_old_models": 2, - "identifier": "test58", + "identifier": "live-freqai", "train_period_days": 18, "backtest_period_days": 2, "live_retrain_hours": 2, diff --git a/tools/dryrun.sh b/tools/dryrun.sh index 2debd3cb..d44e0564 100755 --- a/tools/dryrun.sh +++ b/tools/dryrun.sh @@ -229,7 +229,7 @@ done # 加载策略配置 STRATEGY_NAME=${STRATEGY_NAME:-TheForceV7} -CONFIG_FILE=${CONFIG_FILE:-basic.json} +CONFIG_FILE=${CONFIG_FILE:-freqaiprimer.json} # 修改:使用 freqaiprimer.json 作为基础配置 PARAMS_NAME=$(echo "$STRATEGY_NAME" | tr '[:upper:]' '[:lower:]') echo "使用策略: $STRATEGY_NAME" >&2 diff --git a/tools/live.sh b/tools/live.sh index b6b0553a..cb89aac1 100755 --- a/tools/live.sh +++ b/tools/live.sh @@ -245,7 +245,7 @@ done # 加载策略配置 STRATEGY_NAME=${STRATEGY_NAME:-TheForceV7} -CONFIG_FILE=${CONFIG_FILE:-basic.json} +CONFIG_FILE=${CONFIG_FILE:-freqaiprimer.json} # 修改:使用 freqaiprimer.json 作为基础配置 PARAMS_NAME=$(echo "$STRATEGY_NAME" | tr '[:upper:]' '[:lower:]') echo "使用策略: $STRATEGY_NAME" >&2 @@ -305,9 +305,10 @@ echo "准备启动容器: $CONTAINER_NAME" >&2 # 清理临时文件放置交叉感染 cd ../ source .venv/bin/activate -rm -rf user_data/models/* -rm -rf ./freqtrade/user_data/data/backtest_results/* -rm -fr ./user_data/dryrun_results/* +# 注释掉删除模型命令,保留已训练的模型以便复用 +# rm -rf user_data/models/* # ❌ 不删除:保留训练好的模型 +rm -rf ./freqtrade/user_data/data/backtest_results/* # ✅ 仅清理回测结果 +rm -fr ./user_data/dryrun_results/* # ✅ 仅清理 dryrun 结果 cd - # 第3步:启动新容器