From 30114fab766a95d8390629c2bec2844bef7160fe Mon Sep 17 00:00:00 2001 From: chenxy123 Date: Sat, 14 May 2016 17:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0IB=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E5=A7=94=E6=89=98=E5=8F=B7=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vn.trader/dataRecorder/uiDrWidget.py | 14 +++++++------- vn.trader/ibGateway/ibGateway.py | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/vn.trader/dataRecorder/uiDrWidget.py b/vn.trader/dataRecorder/uiDrWidget.py index cf900459..b9a21190 100644 --- a/vn.trader/dataRecorder/uiDrWidget.py +++ b/vn.trader/dataRecorder/uiDrWidget.py @@ -119,26 +119,26 @@ class DrEngineManager(QtGui.QWidget): def updateSetting(self): """显示引擎行情记录配置""" with open(self.drEngine.settingFileName) as f: - setting = json.load(f) + drSetting = json.load(f) - if 'tick' in setting: - l = setting['tick'] + if 'tick' in drSetting: + l = drSetting['tick'] for setting in l: self.tickTable.insertRow(0) self.tickTable.setItem(0, 0, TableCell(setting[0])) self.tickTable.setItem(0, 1, TableCell(setting[1])) - if 'bar' in setting: - l = setting['bar'] + if 'bar' in drSetting: + l = drSetting['bar'] for setting in l: self.barTable.insertRow(0) self.barTable.setItem(0, 0, TableCell(setting[0])) self.barTable.setItem(0, 1, TableCell(setting[1])) - if 'active' in setting: - d = setting['active'] + if 'active' in drSetting: + d = drSetting['active'] for activeSymbol, symbol in d.items(): self.activeTable.insertRow(0) diff --git a/vn.trader/ibGateway/ibGateway.py b/vn.trader/ibGateway/ibGateway.py index 1cf90b79..66142aa3 100644 --- a/vn.trader/ibGateway/ibGateway.py +++ b/vn.trader/ibGateway/ibGateway.py @@ -250,6 +250,10 @@ class IbGateway(VtGateway): # 查询下一个有效编号 self.connection.reqIds(1) + + # 返回委托编号 + vtOrderID = '.'.join([self.gatewayName, str(self.orderId)]) + return vtOrderID #---------------------------------------------------------------------- def cancelOrder(self, cancelOrderReq):