1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 20:41:09 +08:00

Fix bug when Account.benchmark_config is None

This commit is contained in:
you-n-g
2021-08-09 19:23:17 +08:00
committed by GitHub
parent 7c858803f0
commit 05b9fb5a47

View File

@@ -130,7 +130,8 @@ class Account:
# fill stock value
# The frequency of account may not align with the trading frequency.
# This may result in obscure bugs when data quality is low.
self.current.fill_stock_value(self.benchmark_config["start_time"], self.freq)
if isinstance(self.benchmark_config, dict) and self.benchmark_config.get("start_time") is not None:
self.current.fill_stock_value(self.benchmark_config["start_time"], self.freq)
# trading related metrics(e.g. high-frequency trading)
self.indicator = Indicator()