fixed missing programmed_stop flag toggle

This commit is contained in:
Nicolás Sánchez 2025-03-01 13:07:29 -03:00
parent bb796f6933
commit f6dba9a098
1 changed files with 2 additions and 1 deletions

View File

@ -1665,7 +1665,7 @@ def unwrapped_last_call(base,quote):
def unwrapped_deferred_last_call(base,quote,yyyymmdd):
'''
Programs the trader to not open new deals from a certain future date. Like a VCR.
Programs the trader to not open new deals from a certain future date.
Parameters:
base (str): The base currency of the pair.
@ -1686,6 +1686,7 @@ def unwrapped_deferred_last_call(base,quote,yyyymmdd):
for x in running_instances:
if f"{base}{quote}"==x.pair:
x.config.set_programmed_stop_time(limit)
x.config.set_programmed_stop(True)
#save config file to disk
x.broker.rewrite_config_file()
return jsonify({"Success": f"Trader scheduled to go offline when profit is reached after {limit}"})