From d2c388aa34f6a9329060335d7f9f137fde1d6815 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 15 Nov 2019 10:51:40 +0800 Subject: [PATCH] [Fix] query history data bug --- vnpy/gateway/bybit/bybit_gateway.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vnpy/gateway/bybit/bybit_gateway.py b/vnpy/gateway/bybit/bybit_gateway.py index b123bedc..b0ed8236 100644 --- a/vnpy/gateway/bybit/bybit_gateway.py +++ b/vnpy/gateway/bybit/bybit_gateway.py @@ -532,8 +532,9 @@ class BybitRestApi(RestClient): else: data = resp.json() - ret_msg = data["ret_msg"] - if ret_msg != "ok": + ret_code = data["ret_code"] + if ret_code: + ret_msg = data["ret_msg"] msg = f"获取历史数据出错,错误信息:{ret_msg}" self.gateway.write_log(msg) break