修复ctaTemplate中的发单bug(交易停止时应该返回空字符串,而不是None)
This commit is contained in:
parent
7f4762828b
commit
7ee3ffbd5d
@ -120,11 +120,16 @@ class CtaTemplate(object):
|
|||||||
vtOrderID = self.ctaEngine.sendOrder(self.vtSymbol, orderType, price, volume, self)
|
vtOrderID = self.ctaEngine.sendOrder(self.vtSymbol, orderType, price, volume, self)
|
||||||
return vtOrderID
|
return vtOrderID
|
||||||
else:
|
else:
|
||||||
return None
|
# 交易停止时发单返回空字符串
|
||||||
|
return ''
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def cancelOrder(self, vtOrderID):
|
def cancelOrder(self, vtOrderID):
|
||||||
"""撤单"""
|
"""撤单"""
|
||||||
|
# 如果发单号为空字符串,则不进行后续操作
|
||||||
|
if not vtOrderID:
|
||||||
|
return
|
||||||
|
|
||||||
if STOPORDERPREFIX in vtOrderID:
|
if STOPORDERPREFIX in vtOrderID:
|
||||||
self.ctaEngine.cancelStopOrder(vtOrderID)
|
self.ctaEngine.cancelStopOrder(vtOrderID)
|
||||||
else:
|
else:
|
||||||
|
@ -355,7 +355,7 @@ class VtContractData(VtBaseData):
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Constructor"""
|
"""Constructor"""
|
||||||
super(VtBaseData, self).__init__()
|
super(VtContractData, self).__init__()
|
||||||
|
|
||||||
self.symbol = EMPTY_STRING # 代码
|
self.symbol = EMPTY_STRING # 代码
|
||||||
self.exchange = EMPTY_STRING # 交易所代码
|
self.exchange = EMPTY_STRING # 交易所代码
|
||||||
|
Loading…
Reference in New Issue
Block a user