策略在回测和模拟模式下将不再受到冷启动保护的限制,而在实盘模式下仍能正常工作

This commit is contained in:
zhangkun9038@dingtalk.com 2026-02-04 17:42:55 +08:00
parent 1be894a618
commit 8cad1b5ba0

View File

@ -900,9 +900,8 @@ class FreqaiPrimer(IStrategy):
# 冷启动保护程序启动后前20分钟内不允许入场
if hasattr(self, "_strategy_start_time"):
# 在回测模式下禁用冷启动保护
runmode = self.config.get("runmode", RunMode.LIVE)
if runmode != RunMode.BACKTEST:
# 在非实盘环境(回测/模拟)下禁用冷启动保护
if not self.config.get("dry_run", False):
warmup_minutes = 20
elapsed_minutes = (current_time - self._strategy_start_time).total_seconds() / 60.0
if elapsed_minutes < warmup_minutes: