From 90bbf2b7c6a6456f3dbe8ac237c0f0ae0f33c19b Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 30 Jun 2021 08:29:47 +0800 Subject: [PATCH] Fix account update bar_count bug --- qlib/backtest/account.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qlib/backtest/account.py b/qlib/backtest/account.py index a6ef2f6b8..6167ee407 100644 --- a/qlib/backtest/account.py +++ b/qlib/backtest/account.py @@ -263,11 +263,11 @@ class Account: elif atomic is False and inner_order_indicators is None: raise ValueError("inner_order_indicators is necessary in unatomic executor") + # TODO: `update_bar_count` and `update_current` should placed in Position and be merged. + self.update_bar_count() + self.update_current(trade_start_time, trade_end_time, trade_exchange) if generate_report: # report is portfolio related analysis - # TODO: `update_bar_count` and `update_current` should placed in Position and be merged. - self.update_bar_count() - self.update_current(trade_start_time, trade_end_time, trade_exchange) self.update_report(trade_start_time, trade_end_time) # indicator is trading (e.g. high-frequency order execution) related analysis