diff --git a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py index 0f159152..88db33ab 100644 --- a/vnpy/trader/app/ctaStrategy/ctaBacktesting.py +++ b/vnpy/trader/app/ctaStrategy/ctaBacktesting.py @@ -353,7 +353,8 @@ class BacktestingEngine(object): self.strategy.onOrder(order) # 从字典中删除该限价单 - del self.workingLimitOrderDict[orderID] + if orderID in self.workingLimitOrderDict: + del self.workingLimitOrderDict[orderID] #---------------------------------------------------------------------- def crossStopOrder(self):