[Fix] close #545

This commit is contained in:
vn.py 2017-10-16 14:47:10 +08:00
parent 4b1af5e10e
commit 19bf554ecb
2 changed files with 4 additions and 3 deletions

View File

@ -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:

View File

@ -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):