调整阈值判断逻辑,从 0.6/0.4 改为 0.5/0.3

This commit is contained in:
zhangkun9038@dingtalk.com 2025-12-23 20:33:19 +08:00
parent 7471fc7d3b
commit a2d964bee6

View File

@ -894,8 +894,8 @@ class FreqaiPrimer(IStrategy):
if current_profit <= 0.02:
dynamic_threshold *= 0.8
# 新逻辑:如果 AI 预测需要长期持有hold_duration_signal=1),且持仓时间还很短,则提高阈值
if hold_duration_signal is not None and hold_duration_signal > 0.6: # AI 预测需要长期持有
# 新逻辑:如果 AI 预测需要长期持有hold_duration_signal > 0.5),且持仓时间还很短,则提高阈值
if hold_duration_signal is not None and hold_duration_signal > 0.5: # AI 预测需要长期持有从0.6降至0.5
# 如果持仓时间 < 30分钟阈值提高 50%,更难出场
if trade_age_minutes < 30:
dynamic_threshold *= 1.5
@ -905,7 +905,7 @@ class FreqaiPrimer(IStrategy):
# 如果持仓时间 30-60分钟阈值提高 20%
elif trade_age_minutes < 60:
dynamic_threshold *= 1.2
elif hold_duration_signal is not None and hold_duration_signal < 0.4: # AI 预测短期快速出场
elif hold_duration_signal is not None and hold_duration_signal < 0.3: # AI 预测短期快速出场从0.4降至0.3
# 阈值降低 20%,更容易出场
dynamic_threshold *= 0.8
logger.info(