diff --git a/vnpy/trader/app/ctaStrategy/ctaEngine.py b/vnpy/trader/app/ctaStrategy/ctaEngine.py index dff400de..a13177c3 100644 --- a/vnpy/trader/app/ctaStrategy/ctaEngine.py +++ b/vnpy/trader/app/ctaStrategy/ctaEngine.py @@ -621,8 +621,9 @@ class CtaEngine(object): """全部撤单""" s = self.strategyOrderDict[name] - # 遍历集合,全部撤单 - for orderID in s: + # 遍历列表,全部撤单 + # 这里不能直接遍历集合s,因为撤单时会修改s中的内容,导致出错 + for orderID in list(s): if STOPORDERPREFIX in orderID: self.cancelStopOrder(orderID) else: diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index d343ae35..37920001 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -794,7 +794,7 @@ class PositionDetail(object): self.longPosFrozen = self.longYdFrozen + self.longTdFrozen self.shortPosFrozen = self.shortYdFrozen + self.shortTdFrozen - self.output() + #self.output() #---------------------------------------------------------------------- def output(self):