绿色通道入场机制
This commit is contained in:
parent
b81b2ce2e1
commit
8478f4e531
@ -616,18 +616,6 @@ class FreqaiPrimer(IStrategy):
|
||||
buy_condition = cond1 & cond2 & cond3 & cond4 & cond5 & cond6 & cond7
|
||||
logger.info(f"[{pair}] 🚀 牛市正常通道:持仓{open_trades}>2个,75USDT入场,必须满足全部7个条件")
|
||||
|
||||
else:
|
||||
# 熊市/震荡:严格标准,75USDT入场,必须满足全部7个条件
|
||||
cond1 = (dataframe["&-price_value_divergence"] < self.buy_threshold * 0.7) # 严格到0.7倍
|
||||
cond2 = (dataframe["volume_z_score"] > volume_z_score_threshold * 1.3) # 提高成交量要求
|
||||
cond3 = (dataframe["rsi"] < rsi_threshold * 0.8) # 严格RSI要求
|
||||
cond4 = (dataframe["close"] <= dataframe["bb_lowerband"] * 0.95) # 必须跌破下轨
|
||||
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold * 0.8) # 严格STOCHRSI要求
|
||||
cond6 = ~bearish_signal_aligned # 保持熊市过滤
|
||||
cond7 = ~stochrsi_overbought_aligned # 保持超买过滤
|
||||
buy_condition = cond1 & cond2 & cond3 & cond4 & cond5 & cond6 & cond7
|
||||
logger.info(f"[{pair}] 📉 熊市/震荡通道:75USDT入场,必须满足全部7个条件")
|
||||
|
||||
elif trend_status == "bearish":
|
||||
# 下跌趋势:严格入场条件,只抄底
|
||||
cond1 = (dataframe["&-price_value_divergence"] < self.buy_threshold * 0.7) # 严格到0.7倍
|
||||
@ -637,6 +625,7 @@ class FreqaiPrimer(IStrategy):
|
||||
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold * 0.8) # 严格STOCHRSI要求
|
||||
cond6 = ~bearish_signal_aligned # 保持熊市过滤
|
||||
cond7 = ~stochrsi_overbought_aligned # 保持超买过滤
|
||||
buy_condition = cond1 & cond2 & cond3 & cond4 & cond5 & cond6 & cond7
|
||||
logger.info(f"[{pair}] 📉 下跌趋势策略:严格入场条件")
|
||||
|
||||
else: # ranging
|
||||
@ -648,6 +637,7 @@ class FreqaiPrimer(IStrategy):
|
||||
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold)
|
||||
cond6 = ~bearish_signal_aligned
|
||||
cond7 = ~stochrsi_overbought_aligned
|
||||
buy_condition = cond1 & cond2 & cond3 & cond4 & cond5 & cond6 & cond7
|
||||
logger.info(f"[{pair}] ⚖️ 震荡趋势策略:标准入场条件")
|
||||
|
||||
# 绿色通道和趋势状态的条件已经设置好buy_condition
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user