From 82ecab24a0ae4a9bb2378935acb1467f4f5f3cc8 Mon Sep 17 00:00:00 2001 From: G_will Date: Fri, 26 Oct 2018 15:14:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/vtEngine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/trader/vtEngine.py b/vnpy/trader/vtEngine.py index 489a6dfd..63499977 100644 --- a/vnpy/trader/vtEngine.py +++ b/vnpy/trader/vtEngine.py @@ -413,7 +413,7 @@ class DataEngine(object): self.workingOrderDict = {} # 可撤销委托 self.tradeDict = {} self.accountDict = {} - self.positionDict= {} + self.positionDict = {} self.logList = [] self.errorList = [] From 59c99caf187a7dc59209c3d4fb6a11781f2bc8f5 Mon Sep 17 00:00:00 2001 From: G_will Date: Tue, 30 Oct 2018 11:31:29 +0800 Subject: [PATCH 2/5] update gitignore config --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e7e6a00a..1917a8d0 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ build/Makefile .python-version .gitignore temp/ +.venv # setup.py install 临时文件 dist From d3da3c97b32546b0c1390f2f5f30bea009af9c8b Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 1 Nov 2018 00:29:46 -0400 Subject: [PATCH 3/5] =?UTF-8?q?[Mod]=20=E4=BF=AE=E6=94=B9=EF=BC=9ABitmexGa?= =?UTF-8?q?teway=E5=87=BA=E9=94=99=E6=97=B6=E5=B0=86=E4=BC=9A=E5=9C=A8stde?= =?UTF-8?q?rr=E9=87=8C=E9=9D=A2=E6=89=93=E5=8D=B0=E6=9B=B4=E8=AF=A6?= =?UTF-8?q?=E7=BB=86=E7=9A=84=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/bitmexGateway/bitmexGateway.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py index 95745adb..def69c5f 100644 --- a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py +++ b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py @@ -469,7 +469,7 @@ class BitmexWebsocketApi(WebsocketClient): e.errorMsg = exceptionValue self.gateway.onError(e) - traceback.print_exc() + sys.stderr.write(self.exceptionDetail(exceptionType, exceptionValue, tb)) #---------------------------------------------------------------------- def writeLog(self, content): From ad42d4ddac5c260b878b650737d4aa4fa55a797d Mon Sep 17 00:00:00 2001 From: G_will Date: Thu, 1 Nov 2018 14:01:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20travis=20=E5=9C=A8=20p?= =?UTF-8?q?y3=20=E6=97=B6=E7=9A=84=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/Promise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Promise.py b/tests/Promise.py index 2e37d7f0..cae5cc57 100644 --- a/tests/Promise.py +++ b/tests/Promise.py @@ -30,7 +30,7 @@ class Promise(object): raise res[1] else: et, ev, tb = res[1] - raise et, ev, tb + raise et(ev).with_traceback(tb) def set_exception(self, valueOrType, val=None, tb=None): if val is None: From 541c4b6f764d7104f7ca472cc85a7f32b6e22007 Mon Sep 17 00:00:00 2001 From: nanoric Date: Thu, 1 Nov 2018 22:08:12 -0400 Subject: [PATCH 5/5] =?UTF-8?q?[Fix]=20=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E5=BD=93bitmexgateway.socketapi=E5=93=8D=E5=BA=94onTrade?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E9=81=87=E5=88=B0side=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=B8=BA''=E5=AF=BC=E8=87=B4=E5=BC=82=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit an example without 'size': { 'execID': '***', 'execType': 'Funding', 'ordStatus': 'Filled', 'lastLiquidityInd': '', 'exDestination': 'XBME', 'text': 'Funding', 'lastQty': 508, 'timeInForce': 'AtTheClose', 'currency': 'USD', 'pegPriceType': '', 'simpleLeavesQty': None, 'transactTime': '***', 'ordRejReason': '', 'underlyingLastPx': None, 'execCost': 8051292, 'clOrdID': '', 'settlCurrency': 'XBt', 'cumQty': 508, 'displayQty': None, 'lastPx': 6309.35, 'homeNotional': -0.08051292, 'commission': -0.0001, 'avgPx': 6309.35, 'lastMkt': 'XBME', 'price': 6309.35, 'trdMatchID': '***', 'simpleOrderQty': None, 'contingencyType': '', 'triggered': '', 'timestamp': '***', 'symbol': 'XBTUSD', 'foreignNotional': 508, 'pegOffsetValue': None, 'execInst': '', 'simpleCumQty': None, 'execComm': -805, 'orderID': '***', 'multiLegReportingType': 'SingleSecurity', 'account': ***, 'stopPx': None, 'leavesQty': 0, 'tradePublishIndicator': '', 'orderQty': 508, 'workingIndicator': False, 'ordType': 'Limit', 'clOrdLinkID': '', 'side': '' } --- vnpy/trader/gateway/bitmexGateway/bitmexGateway.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py index def69c5f..855efcf9 100644 --- a/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py +++ b/vnpy/trader/gateway/bitmexGateway/bitmexGateway.py @@ -6,6 +6,7 @@ from __future__ import print_function +import logging import os import json import hashlib @@ -573,8 +574,9 @@ class BitmexWebsocketApi(WebsocketClient): trade.tradeID = tradeID trade.vtTradeID = '.'.join([trade.gatewayName, trade.tradeID]) - if 'side' not in d: - print('no side : \n', d) + # bug check: + if d['side'] not in directionMapReverse: + logging.debug('trade wthout side : %s', d) return trade.direction = directionMapReverse[d['side']]