Merge branch 'dev' of https://github.com/vnpy/vnpy into dev

This commit is contained in:
vn.py 2018-11-05 11:11:25 +08:00
commit 68c9c09ac3
4 changed files with 8 additions and 5 deletions

1
.gitignore vendored
View File

@ -58,6 +58,7 @@ build/Makefile
.python-version
.gitignore
temp/
.venv
# setup.py install 临时文件
dist

View File

@ -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:

View File

@ -6,6 +6,7 @@
from __future__ import print_function
import logging
import os
import json
import hashlib
@ -469,7 +470,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):
@ -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']]

View File

@ -413,7 +413,7 @@ class DataEngine(object):
self.workingOrderDict = {} # 可撤销委托
self.tradeDict = {}
self.accountDict = {}
self.positionDict= {}
self.positionDict = {}
self.logList = []
self.errorList = []