removed minor conditionals in some endpoints
This commit is contained in:
parent
a5efd6e992
commit
56cbf51129
24
main.py
24
main.py
|
|
@ -1952,14 +1952,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"})
|
||||
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"})
|
||||
except Exception:
|
||||
return jsonify({"Error": "Halp"})
|
||||
|
||||
|
|
@ -1972,13 +1969,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"})
|
||||
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"})
|
||||
except Exception:
|
||||
return jsonify({"Error": "Halp"})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue