From d2c388aa34f6a9329060335d7f9f137fde1d6815 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 15 Nov 2019 10:51:40 +0800 Subject: [PATCH 1/2] [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 From 71afeb748dc7475cfb45f2769478c7678fd344f5 Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Fri, 15 Nov 2019 11:15:16 +0800 Subject: [PATCH 2/2] [Mod] use pandas 0.24.2 to meet rqdatac requirements --- examples/vn_trader/run.py | 4 ++-- requirements.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/vn_trader/run.py b/examples/vn_trader/run.py index e55a1cef..1c15d1bc 100644 --- a/examples/vn_trader/run.py +++ b/examples/vn_trader/run.py @@ -36,7 +36,7 @@ from vnpy.gateway.bybit import BybitGateway # from vnpy.app.cta_strategy import CtaStrategyApp # from vnpy.app.csv_loader import CsvLoaderApp # from vnpy.app.algo_trading import AlgoTradingApp -# from vnpy.app.cta_backtester import CtaBacktesterApp +from vnpy.app.cta_backtester import CtaBacktesterApp # from vnpy.app.data_recorder import DataRecorderApp # from vnpy.app.risk_manager import RiskManagerApp # from vnpy.app.script_trader import ScriptTraderApp @@ -83,7 +83,7 @@ def main(): main_engine.add_gateway(BybitGateway) # main_engine.add_app(CtaStrategyApp) - # main_engine.add_app(CtaBacktesterApp) + main_engine.add_app(CtaBacktesterApp) # main_engine.add_app(CsvLoaderApp) # main_engine.add_app(AlgoTradingApp) # main_engine.add_app(DataRecorderApp) diff --git a/requirements.txt b/requirements.txt index fd5f8f45..5d69973c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ pymysql psycopg2 mongoengine numpy +pandas==0.24.2 matplotlib seaborn futu-api