Enabling last_call disables autoswitch
This commit is contained in:
parent
a19cf0271c
commit
d0a189b68a
|
|
@ -1,3 +1,6 @@
|
|||
2025.03.29:
|
||||
. Enabling last_call disables autoswitch.
|
||||
|
||||
2025.03.19:
|
||||
. Added the possibility to force specific orders when importing a trader.
|
||||
|
||||
|
|
|
|||
5
main.py
5
main.py
|
|
@ -16,7 +16,7 @@ import exchange_wrapper
|
|||
import trader
|
||||
|
||||
|
||||
version = "2025.03.19"
|
||||
version = "2025.03.29"
|
||||
|
||||
'''
|
||||
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
|
||||
|
|
@ -1678,6 +1678,8 @@ def unwrapped_last_call(base,quote):
|
|||
x.status.set_stop_when_profit(not x.status.get_stop_when_profit())
|
||||
x.update_status(True)
|
||||
if x.status.get_stop_when_profit():
|
||||
x.config.set_autoswitch(False)
|
||||
x.update_status(True)
|
||||
return jsonify({"Success": "Trader scheduled to go offline when profit is reached"})
|
||||
return jsonify({"Success": "Last call cancelled"})
|
||||
return jsonify({"Error": "Trader does not exist"})
|
||||
|
|
@ -1755,6 +1757,7 @@ def unwrapped_global_last_call():
|
|||
#broker.clear_pairs()
|
||||
for x in running_instances:
|
||||
x.status.set_stop_when_profit(True)
|
||||
x.config.set_autoswitch(False)
|
||||
broker.logger.log_this("Modified flag",2,f"{x.base}/{x.quote}")
|
||||
return jsonify({"Success": "All traders scheduled to go offline when profit is reached"})
|
||||
return jsonify({"Error": "No traders running"})
|
||||
|
|
|
|||
Loading…
Reference in New Issue