Skip to content

Commit

Permalink
Merge pull request #6 from noranhe/main
Browse files Browse the repository at this point in the history
[Fix] algo初始化报错的问题
  • Loading branch information
vnpy authored Nov 4, 2022
2 parents b758cb2 + d93b32c commit 2d1d446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vnpy_algotrading/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def register_event(self) -> None:

def process_tick_event(self, event: Event) -> None:
""""""
tick: TickData = event.data
tick: TickData = event.data
algos: Optional[Set[AlgoTemplate]] = self.symbol_algo_map[tick.vt_symbol]

for algo in algos:
Expand Down Expand Up @@ -292,7 +292,7 @@ def put_parameters_event(self, algo: AlgoTemplate, parameters: dict) -> None:
def put_variables_event(self, algo: AlgoTemplate, variables: dict) -> None:
""""""
# 检查算法是否运行结束
if not variables["active"]:
if not variables["active"] and algo in self.algos.values():
self.algos.pop(algo.algo_name)

for algos in self.symbol_algo_map.values():
Expand Down

0 comments on commit 2d1d446

Please sign in to comment.