From a155e8f0a5910af87125911fe697c1c4890201de Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 1 Dec 2017 22:33:10 +0800 Subject: [PATCH] [Fix]Close #610 --- vnpy/trader/app/ctaStrategy/ctaBacktesting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):