增加特征
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
Some checks are pending
Update Docker Hub Description / dockerHubDescription (push) Waiting to run
This commit is contained in:
parent
03a54a5b0a
commit
8477bf07c7
@ -68,8 +68,8 @@
|
||||
"purge_old_models": 2,
|
||||
"train_period_days": 15,
|
||||
"identifier": "test62",
|
||||
"train_period_days": 30,
|
||||
"backtest_period_days": 10,
|
||||
"train_period_days": 90,
|
||||
"backtest_period_days": 30,
|
||||
"live_retrain_hours": 0,
|
||||
"feature_selection": {
|
||||
"method": "recursive_elimination"
|
||||
|
||||
@ -30,12 +30,12 @@ class FreqaiExampleStrategy(IStrategy):
|
||||
|
||||
# FreqAI 配置
|
||||
freqai_info = {
|
||||
"model": "XGBoostRegressor", # 改用XGBoost
|
||||
"model": "CatboostClassifier", # 与config保持一致
|
||||
"feature_parameters": {
|
||||
"include_timeframes": ["5m", "15m", "1h"],
|
||||
"include_corr_pairlist": [],
|
||||
"label_period_candles": 12,
|
||||
"include_shifted_candles": 3,
|
||||
"include_timeframes": ["3m", "15m", "1h"], # 与config一致
|
||||
"include_corr_pairlist": ["BTC/USDT", "SOL/USDT"], # 添加相关交易对
|
||||
"label_period_candles": 20, # 与config一致
|
||||
"include_shifted_candles": 2, # 与config一致
|
||||
},
|
||||
"data_split_parameters": {
|
||||
"test_size": 0.2,
|
||||
@ -308,8 +308,9 @@ class FreqaiExampleStrategy(IStrategy):
|
||||
# 改进买入信号条件
|
||||
enter_long_conditions = [
|
||||
(df["rsi"] < df["buy_rsi_pred"]), # RSI 低于买入阈值
|
||||
(df["volume"] > df["volume"].rolling(window=10).mean()), # 成交量高于近期均值
|
||||
(df["close"] > df["bb_middleband"]) # 价格高于布林带中轨
|
||||
(df["volume"] > df["volume"].rolling(window=10).mean() * 1.2), # 成交量高于近期均值20%
|
||||
(df["close"] > df["bb_middleband"]), # 价格高于布林带中轨
|
||||
(df["do_predict"] == 1) # 确保模型预测为买入
|
||||
]
|
||||
if enter_long_conditions:
|
||||
df.loc[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user