Allow disabling accounts
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user