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):