趋势获取采用了新的方式
This commit is contained in:
parent
c45e223692
commit
cd4a5b7518
@ -438,8 +438,8 @@ class FreqaiPrimer(IStrategy):
|
||||
cond3 = (dataframe["rsi"] < rsi_threshold * 1.2) # 放宽RSI要求
|
||||
cond4 = (dataframe["close"] <= dataframe["bb_upperband"]) # 可以在上轨附近入场
|
||||
cond5 = (dataframe["stochrsi_k"] < stochrsi_threshold * 1.2) # 放宽STOCHRSI要求
|
||||
cond6 = True # 取消熊市过滤
|
||||
cond7 = True # 取消超买过滤
|
||||
cond6 = pd.Series([True] * len(dataframe), index=dataframe.index) # 取消熊市过滤
|
||||
cond7 = pd.Series([True] * len(dataframe), index=dataframe.index) # 取消超买过滤
|
||||
logger.info(f"[{pair}] 🚀 上涨趋势策略:放宽入场条件")
|
||||
|
||||
elif trend_status == "bearish":
|
||||
@ -503,17 +503,6 @@ class FreqaiPrimer(IStrategy):
|
||||
combined_condition = reduce(lambda x, y: x & y, conditions)
|
||||
dataframe.loc[combined_condition, 'enter_long'] = 1
|
||||
|
||||
# 创建条件总结列表
|
||||
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]),
|
||||
]
|
||||
|
||||
# 输出每个条件的状态
|
||||
logger.info(f"[{pair}] === 买入条件检查 ===")
|
||||
satisfied_conditions = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user