[Fix]Close #995
This commit is contained in:
parent
438bab3fff
commit
1d5d7af64b
@ -87,9 +87,6 @@ class BitmexGateway(VtGateway):
|
||||
self.restApi.connect(apiKey, apiSecret, sessionCount)
|
||||
self.wsApi.connect(apiKey, apiSecret, symbols)
|
||||
|
||||
# 初始化并启动查询
|
||||
#self.initQuery()
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
def subscribe(self, subscribeReq):
|
||||
"""订阅行情"""
|
||||
|
@ -488,7 +488,11 @@ class CcxtApi(object):
|
||||
tick.lowPrice = float(data['low'])
|
||||
tick.lastPrice = float(data['close'])
|
||||
tick.volume = float(data['quoteVolume'])
|
||||
tick.datetime = datetime.fromtimestamp(data['timestamp']/1000)
|
||||
|
||||
if data['timestamp']:
|
||||
tick.datetime = datetime.fromtimestamp(data['timestamp']/1000)
|
||||
else:
|
||||
tick.datetime = datetime.now()
|
||||
tick.date = tick.datetime.strftime('%Y%m%d')
|
||||
tick.time = tick.datetime.strftime('%H:%M:%S')
|
||||
|
||||
@ -510,7 +514,10 @@ class CcxtApi(object):
|
||||
tick.__setattr__('askPrice%s' %(n+1), float(ask[0]))
|
||||
tick.__setattr__('askVolume%s' %(n+1), float(ask[1]))
|
||||
|
||||
tick.datetime = datetime.fromtimestamp(data['timestamp']/1000)
|
||||
if data['timestamp']:
|
||||
tick.datetime = datetime.fromtimestamp(data['timestamp']/1000)
|
||||
else:
|
||||
tick.datetime = datetime.now()
|
||||
tick.date = tick.datetime.strftime('%Y%m%d')
|
||||
tick.time = tick.datetime.strftime('%H:%M:%S')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user