[Add]增加停止单触发时对于委托失败的检查处理

This commit is contained in:
vn.py 2018-08-03 20:57:48 +08:00
parent 9be16f46ce
commit 176c4f26b1

View File

@ -234,8 +234,11 @@ class CtaEngine(object):
price = tick.lowerLimit price = tick.lowerLimit
# 发出市价委托 # 发出市价委托
self.sendOrder(so.vtSymbol, so.orderType, price, so.volume, so.strategy) vtOrderID = self.sendOrder(so.vtSymbol, so.orderType,
price, so.volume, so.strategy)
# 检查因为风控流控等原因导致的委托失败(无委托号)
if vtOrderID:
# 从活动停止单字典中移除该停止单 # 从活动停止单字典中移除该停止单
del self.workingStopOrderDict[so.stopOrderID] del self.workingStopOrderDict[so.stopOrderID]