removed conditionals in some endpoints

This commit is contained in:
Nicolás Sánchez 2025-09-01 14:19:20 -03:00
parent 23d85de155
commit 694e5a95d1
1 changed files with 17 additions and 24 deletions

View File

@ -1950,7 +1950,6 @@ def unwrapped_last_call(base,quote):
try:
symbol = f"{base}/{quote}"
if symbol in broker.get_pairs(): #Why was this?
for instance in running_traders:
if symbol==instance.status.get_pair():
instance.status.set_stop_when_profit(not instance.status.get_stop_when_profit())
@ -2032,14 +2031,11 @@ def unwrapped_global_last_call():
jsonify: A jsonified dictionary detailing the outcome of the operation.
'''
try:
if broker.get_pairs!=[]:
#broker.clear_pairs()
for instance in running_traders:
instance.status.set_stop_when_profit(True)
instance.config.set_autoswitch(False)
broker.logger.log_this("Modified flag",2,f"{instance.base}/{instance.quote}")
return jsonify({"Success": "All traders scheduled to go offline when profit is reached"})
return jsonify({"Error": "No traders running"})
except Exception:
return jsonify({"Error": "Halp"})
@ -2052,13 +2048,10 @@ def unwrapped_cancel_global_last_call():
jsonify: A jsonified dictionary detailing the outcome of the operation.
'''
try:
if broker.get_pairs!=[]:
#broker.clear_pairs()
for instance in running_traders:
instance.status.set_stop_when_profit(False)
broker.logger.log_this("Modified flag",2,f"{instance.base}/{instance.quote}")
return jsonify({"Success": "Last call canceled"})
return jsonify({"Error": "No traders running"})
except Exception:
return jsonify({"Error": "Halp"})