Allow disabling accounts

This commit is contained in:
2023-01-01 15:46:40 +00:00
parent a18c150fe2
commit b31a2d1464
6 changed files with 40 additions and 3 deletions

View File

@@ -286,6 +286,13 @@ def execute_strategy(callback, strategy, func):
log.debug("Not within trading time range")
return
# Don't touch the account if it's disabled.
# We still want to set trends, though.
if func in ("entry", "exit"):
if not strategy.account.enabled:
log.debug("Account is disabled, exiting")
return
# Instruments supported by the account
if not strategy.account.instruments:
strategy.account.update_info()