绿色通道入场机制

This commit is contained in:
zhangkun9038@dingtalk.com 2025-08-18 01:11:32 +08:00
parent 8478f4e531
commit 9494d7f557

View File

@ -650,15 +650,18 @@ class FreqaiPrimer(IStrategy):
stochrsi_value = dataframe["stochrsi_k"].iloc[-1]
bb_close_value = dataframe["close"].iloc[-1]
bb_lower_value = dataframe["bb_lowerband"].iloc[-1]
# 定义条件名称和状态
# 定义条件名称和状态 - 确保所有cond变量都已定义
cond6_defined = ~bearish_signal_aligned if 'bearish_signal_aligned' in locals() else pd.Series([True] * len(dataframe))
cond7_defined = ~stochrsi_overbought_aligned if 'stochrsi_overbought_aligned' in locals() else pd.Series([True] * len(dataframe))
conditions_summary = [
("&-price_value_divergence", divergence_value, "<", self.buy_threshold, cond1.iloc[-1]),
("volume_z_score", volume_z_score_value, ">", volume_z_score_threshold, cond2.iloc[-1]),
("rsi", rsi_value, "<", rsi_threshold, cond3.iloc[-1]),
("close <= bb_lowerband", bb_close_value, "<=", bb_lower_value, cond4.iloc[-1]),
("stochrsi_k", stochrsi_value, "<", stochrsi_threshold, cond5.iloc[-1]),
("非熊市", None, None, None, cond6.iloc[-1]),
("STOCHRSI未持续超买", None, None, None, cond7.iloc[-1]),
("非熊市", None, None, None, cond6_defined.iloc[-1]),
("STOCHRSI未持续超买", None, None, None, cond7_defined.iloc[-1]),
]
# 输出每个条件的状态