From cb835d593266f5a06f7ff400d6652a4ed807d817 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Thu, 7 Nov 2019 16:08:34 +0800 Subject: [PATCH] [Mod] close #2126 --- vnpy/app/algo_trading/engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vnpy/app/algo_trading/engine.py b/vnpy/app/algo_trading/engine.py index fa72e59b..6b1acfd1 100644 --- a/vnpy/app/algo_trading/engine.py +++ b/vnpy/app/algo_trading/engine.py @@ -96,7 +96,10 @@ class AlgoEngine(BaseEngine): def process_timer_event(self, event: Event): """""" - for algo in self.algos.values(): + # Generate a list of algos first to avoid dict size change + algos = list(self.algos.values()) + + for algo in algos: algo.update_timer() def process_trade_event(self, event: Event):