策略在回测和模拟模式下将不再受到冷启动保护的限制,而在实盘模式下仍能正常工作
This commit is contained in:
parent
1be894a618
commit
8cad1b5ba0
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user