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 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