mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-03 12:40:47 +08:00
Referencing context.account in handle_data() can block updates to account, portfolio and performance metrics, which can cause unintended changes in financial performance. Additionally, since context.account metrics are not updating frequenctly enough (daily, rather than minutely) algos which base decisions on these metrics can have undesired behavior. To address this we do not base our decision to update performance on the state of account_needs_update. When we call get_account() from the market and minute close methods, we set the performance_needs_update parameter to False since we just updated performance. _get_account() is renamed to _update_account() since the method does not return account information. Also remove redundant asset_needs_update = True lines.