[Fix]修复OKEXF接口的5档行情顺序bug #1275

This commit is contained in:
vn.py 2018-12-24 20:36:52 +08:00
parent 483b754f09
commit 1add685b53

View File

@ -686,8 +686,8 @@ class OkexfWebsocketApi(WebsocketClient):
for n, buf in enumerate(data['asks']):
price, volume = buf[:2]
tick.__setattr__('askPrice%s' %(n+1), float(price))
tick.__setattr__('askVolume%s' %(n+1), int(volume))
tick.__setattr__('askPrice%s' %(5-n), float(price))
tick.__setattr__('askVolume%s' %(5-n), int(volume))
dt = datetime.fromtimestamp(data['timestamp']/1000)
tick.date = dt.strftime('%Y%m%d')