combined_condition update
This commit is contained in:
parent
75ffe320d0
commit
92371eb784
@ -277,13 +277,19 @@ class FreqaiPrimer(IStrategy):
|
||||
logger.warning(f"[{pair}] ⚠️ &-price_value_divergence 列缺失,跳过该条件")
|
||||
|
||||
if len(conditions) > 0:
|
||||
dataframe.loc[reduce(lambda x, y: x & y, conditions), 'enter_long'] = 1
|
||||
# 检查是否同时有卖出信号
|
||||
if 'exit_long' in dataframe.columns and (dataframe["exit_long"] == 1).any():
|
||||
logger.warning(f"[{pair}] 同时检测到买入和卖出信号,忽略买入信号")
|
||||
dataframe['enter_long'] = 0
|
||||
combined_condition = reduce(lambda x, y: x & y, conditions)
|
||||
if combined_condition.any():
|
||||
dataframe.loc[combined_condition, 'enter_long'] = 1
|
||||
|
||||
if 'exit_long' in dataframe.columns and (dataframe["exit_long"] == 1).any():
|
||||
logger.warning(f"[{pair}] 同时检测到买入和卖出信号,忽略买入信号")
|
||||
dataframe['enter_long'] = 0
|
||||
else:
|
||||
logger.debug(f"[{pair}] 入场信号触发,条件满足")
|
||||
else:
|
||||
logger.debug(f"[{pair}] 入场信号触发,条件满足") # 改为 DEBUG 级别
|
||||
logger.debug(f"[{pair}] 买入条件均不满足,未触发入场信号")
|
||||
else:
|
||||
logger.debug(f"[{pair}] 无有效买入条件")
|
||||
|
||||
return dataframe
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user