diff --git a/vnpy/app/cta_backtester/engine.py b/vnpy/app/cta_backtester/engine.py index b7267fe2..9da8e6f7 100644 --- a/vnpy/app/cta_backtester/engine.py +++ b/vnpy/app/cta_backtester/engine.py @@ -329,14 +329,14 @@ class BacktesterEngine(BaseEngine): symbol, exchange, Interval(interval), start, end ) - if not data: + if data: + database_manager.save_bar_data(data) + self.write_log(f"{vt_symbol}-{interval}历史数据下载完成") + else: self.write_log(f"数据下载失败,无法获取{vt_symbol}的历史数据") - database_manager.save_bar_data(data) - # Clear thread object handler. self.thread = None - self.write_log(f"{vt_symbol}-{interval}历史数据下载完成") def start_downloading( self,