diff --git a/freqtrade/templates/FreqaiExampleStrategy.py b/freqtrade/templates/FreqaiExampleStrategy.py index 2a5534a..4c707ad 100644 --- a/freqtrade/templates/FreqaiExampleStrategy.py +++ b/freqtrade/templates/FreqaiExampleStrategy.py @@ -280,11 +280,13 @@ class FreqaiExampleStrategy(IStrategy): # 更保守的追踪止损设置 self.trailing_stop_positive = 0.05 # 追踪止损触发点 self.trailing_stop_positive_offset = 0.1 # 追踪止损偏移量 - - logger.info(f"动态参数:buy_rsi={self.buy_rsi.value}, sell_rsi={self.sell_rsi.value}, " - f"stoploss={self.stoploss}, trailing_stop_positive={self.trailing_stop_positive}") - - dataframe.replace([np.inf, -np.inf], 0, inplace=True) + exit_long_conditions = [ + (df["rsi"] > df["sell_rsi_pred"]), # RSI 高于卖出阈值 + (df["volume"] > df["volume"].rolling(window=10).mean()), # 成交量高于近期均值 + (df["close"] < df["bb_middleband"]), # 价格低于布林带中轨 + (df["close"] < df["bb_lowerband"].shift(1)), # 当前价格低于上一周期的布林带下轨 + (df["volume"] < df["volume"].shift(1) * 0.9) # 当前成交量低于上一周期的10% + ] dataframe.ffill(inplace=True) dataframe.fillna(0, inplace=True)