From 254f5abb6b62285f6f3c1df5ca0b9316b9d3dfc2 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 21 Mar 2018 10:47:00 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BF=AE=E5=A4=8DOM=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=BC=95=E6=93=8E=E7=9A=84vtSymbol=E5=92=8Cstrategy=E6=98=A0?= =?UTF-8?q?=E5=B0=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/app/optionMaster/omEngine.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vnpy/trader/app/optionMaster/omEngine.py b/vnpy/trader/app/optionMaster/omEngine.py index 7d17ec85..8f9a5e8e 100644 --- a/vnpy/trader/app/optionMaster/omEngine.py +++ b/vnpy/trader/app/optionMaster/omEngine.py @@ -362,7 +362,11 @@ class OmStrategyEngine(object): # 保存Tick映射关系 for vtSymbol in strategy.vtSymbols: - l = self.symbolStrategyDict.setdefault(vtSymbol, []) + if vtSymbol in self.symbolStrategyDict: + l = self.symbolStrategyDict[vtSymbol] + else: + l = [] + self.symbolStrategyDict[vtSymbol] = l l.append(strategy) #----------------------------------------------------------------------