Merge pull request #1207 from nanoric/fix_bitemex_onTrade_error_without_side
[Fix] 修复了当bitmexgateway.socketapi响应onTrade时,遇到side字段为''导致异常的情况。
This commit is contained in:
commit
8baad896a8
@ -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']]
|
||||
|
Loading…
Reference in New Issue
Block a user