diff --git a/vn.trader/ctpGateway/ctpGateway.py b/vn.trader/ctpGateway/ctpGateway.py index af21694c..7026f87f 100644 --- a/vn.trader/ctpGateway/ctpGateway.py +++ b/vn.trader/ctpGateway/ctpGateway.py @@ -789,6 +789,7 @@ class CtpTdApi(TdApi): self.gateway.onContract(contract) if last: + #print self.symbolSizeDict log = VtLogData() log.gatewayName = self.gatewayName log.logContent = u'交易合约信息获取完成' @@ -965,6 +966,7 @@ class CtpTdApi(TdApi): order.totalVolume = data['VolumeTotalOriginal'] order.tradedVolume = data['VolumeTraded'] order.orderTime = data['InsertTime'] + order.updateTime = data['UpdateTime'] order.cancelTime = data['CancelTime'] order.frontID = data['FrontID'] order.sessionID = data['SessionID'] @@ -1405,7 +1407,7 @@ class PositionBuffer(object): self.pos.position = data['Position'] self.pos.ydPosition = 0 - if data['Position']: + if data['Position'] != 0 and size!=0: self.pos.price = data['PositionCost'] / (data['Position'] * size) else: self.pos.price = 0 diff --git a/vn.trader/riskManager/rmEngine.py b/vn.trader/riskManager/rmEngine.py index 3c5944a6..cbdd040f 100644 --- a/vn.trader/riskManager/rmEngine.py +++ b/vn.trader/riskManager/rmEngine.py @@ -190,7 +190,7 @@ class RmEngine(object): %(workingOrderCount, self.workingOrderLimit)) return False - self.writeRiskLog(u'DEBUG:Offset:{0},percent:{1},Limit:{2}'.format(orderReq.offset, self.percent, self.percentLimit)) + #self.writeRiskLog(u'DEBUG:Offset:{0},percent:{1},Limit:{2}'.format(orderReq.offset, self.percent, self.percentLimit)) # 检查仓位 add by Incense 20160728 if orderReq.offset == OFFSET_OPEN: diff --git a/vn.trader/uiBasicWidget.py b/vn.trader/uiBasicWidget.py index 2d05c6a6..c544da6f 100644 --- a/vn.trader/uiBasicWidget.py +++ b/vn.trader/uiBasicWidget.py @@ -522,6 +522,7 @@ class OrderMonitor(BasicMonitor): d['orderTime'] = {'chinese':u'委托时间', 'cellType':BasicCell} d['totalVolume'] = {'chinese':u'委托数量', 'cellType':BasicCell} d['tradedVolume'] = {'chinese':u'成交数量', 'cellType':BasicCell} + #d['updateTime'] = {'chinese':u'更新时间', 'cellType':BasicCell} d['cancelTime'] = {'chinese':u'撤销时间', 'cellType':BasicCell} d['frontID'] = {'chinese':u'前置编号', 'cellType':BasicCell} d['sessionID'] = {'chinese':u'会话编号', 'cellType':BasicCell} diff --git a/vn.trader/vtGateway.py b/vn.trader/vtGateway.py index 1a05b2f2..77c4bcef 100644 --- a/vn.trader/vtGateway.py +++ b/vn.trader/vtGateway.py @@ -276,6 +276,7 @@ class VtOrderData(VtBaseData): self.status = EMPTY_UNICODE # 报单状态 self.orderTime = EMPTY_STRING # 发单时间 + self.updateTime = EMPTY_STRING # 最后更新时间 self.cancelTime = EMPTY_STRING # 撤单时间 # CTP/LTS相关