From 1add685b533f31edc0957555589de7d1c008cc13 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Mon, 24 Dec 2018 20:36:52 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=E4=BF=AE=E5=A4=8DOKEXF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9A=845=E6=A1=A3=E8=A1=8C=E6=83=85=E9=A1=BA=E5=BA=8Fbug=20#1?= =?UTF-8?q?275?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/trader/gateway/okexfGateway/okexfGateway.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vnpy/trader/gateway/okexfGateway/okexfGateway.py b/vnpy/trader/gateway/okexfGateway/okexfGateway.py index 6da4b8d8..a62fbb22 100644 --- a/vnpy/trader/gateway/okexfGateway/okexfGateway.py +++ b/vnpy/trader/gateway/okexfGateway/okexfGateway.py @@ -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')