布林带下轨

This commit is contained in:
zhangkun9038@dingtalk.com 2025-08-30 01:03:51 +08:00
parent 98786d1118
commit b7864d69cd

View File

@ -985,15 +985,16 @@ class FreqaiPrimer(IStrategy):
logger.info(f"[{pair}] 🟢 牛市绿色通道:持仓{open_trades}≤2个25USDT入场5条件需要满足{satisfied_count}/4个")
elif trend_status == "bullish":
# 牛市正常通道:持仓>2个75USDT入场必须满足全部7个条件且价格必须低于EMA50
cond1 = (dataframe["&-price_value_divergence"] < self.buy_threshold * 1.2) # 提高要求至1.2
cond2 = (dataframe["volume_z_score"] > volume_z_score_threshold * 0.8) # 提高成交量要求至0.8
cond3 = (dataframe["rsi"] < rsi_threshold * 1.07) # 提高要求至1.0
cond4 = (dataframe["close"] <= dataframe["bb_lowerband"]) # 收盘价低于布林带下轨
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold * 1.0) # 提高要求至1.0
# 牛市正常通道:持仓>2个75USDT入场放宽条件以增加入场信号
cond1 = (dataframe["&-price_value_divergence"] < self.buy_threshold * 1.5) # 进一步放宽至1.5
cond2 = (dataframe["volume_z_score"] > volume_z_score_threshold * 0.6) # 放宽成交量要求至0.6
cond3 = (dataframe["rsi"] < rsi_threshold * 1.05) # 进一步放宽至1.15
cond4 = (dataframe["close"] <= dataframe["bb_lowerband"] * 1.05) # 略微放宽布林带条件
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold * 1.1) # 放宽STOCHRSI要求至1.1
cond6 = pd.Series([True] * len(dataframe), index=dataframe.index) # 取消熊市过滤
cond7 = pd.Series([True] * len(dataframe), index=dataframe.index) # 取消超买过滤
buy_condition = cond1 & cond2 & cond3 & cond4 & cond5 & cond6 & cond7 & price_below_ema50 & ~is_unstable_region & (high_position == 0)
# 只需要满足5个核心条件即可入场
buy_condition = (cond1 & cond2 & cond3 & cond4 & cond5) & cond6 & cond7 & price_below_ema50 & ~is_unstable_region & (high_position == 0)
logger.info(f"[{pair}] 🚀 牛市正常通道:持仓{open_trades}>2个75USDT入场必须满足全部7个条件")
elif trend_status == "bearish":