修复cover方法的bug

This commit is contained in:
msincenselee 2016-09-30 08:19:53 +08:00
parent f1c2216277
commit c9fcaadab3

View File

@ -22,7 +22,7 @@ class CtaTemplate(object):
barDbName = MINUTE_DB_NAME barDbName = MINUTE_DB_NAME
# 策略的基本参数 # 策略的基本参数
name = EMPTY_UNICODE # 策略实例名称 name = 'StrategyName' # 策略实例名称
vtSymbol = EMPTY_STRING # 交易的合约vt系统代码 vtSymbol = EMPTY_STRING # 交易的合约vt系统代码
symbol = EMPTY_STRING # 交易的合约代码除郑商所外与vtSymbol一致一般为两位代码+两位年份+两位月份AU1606SR1605 symbol = EMPTY_STRING # 交易的合约代码除郑商所外与vtSymbol一致一般为两位代码+两位年份+两位月份AU1606SR1605
shortSymbol = EMPTY_STRING # 合约类型代码 shortSymbol = EMPTY_STRING # 合约类型代码
@ -163,7 +163,7 @@ class CtaTemplate(object):
orderID = self.sendOrder(CTAORDER_COVER, price, volume, stop) orderID = self.sendOrder(CTAORDER_COVER, price, volume, stop)
if orderID !='': if orderID !='':
self.entrust = -1 # 置当前策略的委托单状态 self.entrust = 1 # 置当前策略的委托单状态
# 记录委托单 # 记录委托单
self.uncompletedOrders[orderID] = {'DIRECTION': DIRECTION_LONG, self.uncompletedOrders[orderID] = {'DIRECTION': DIRECTION_LONG,
'OFFSET': OFFSET_CLOSE, 'OFFSET': OFFSET_CLOSE,