From 6d6756ae4d41fec60fc93829677c30b3dd8886bd Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Sat, 19 Oct 2019 18:14:54 +0800 Subject: [PATCH] [Mod] show exception message when loading strategy class in cta_backtester --- vnpy/app/cta_backtester/engine.py | 3 +-- vnpy/trader/rqdata.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/vnpy/app/cta_backtester/engine.py b/vnpy/app/cta_backtester/engine.py index 20663cad..4214baa3 100644 --- a/vnpy/app/cta_backtester/engine.py +++ b/vnpy/app/cta_backtester/engine.py @@ -45,8 +45,6 @@ class BacktesterEngine(BaseEngine): # Optimization result self.result_values = None - self.load_strategy_class() - def init_engine(self): """""" self.write_log("初始化CTA回测引擎") @@ -55,6 +53,7 @@ class BacktesterEngine(BaseEngine): # Redirect log from backtesting engine outside. self.backtesting_engine.output = self.write_log + self.load_strategy_class() self.write_log("策略文件加载完成") self.init_rqdata() diff --git a/vnpy/trader/rqdata.py b/vnpy/trader/rqdata.py index 6c1d3e00..04fd17fe 100644 --- a/vnpy/trader/rqdata.py +++ b/vnpy/trader/rqdata.py @@ -1,4 +1,4 @@ -from datetime import datetime, timedelta +from datetime import timedelta from typing import List from rqdatac import init as rqdata_init