2025.09.01

This commit is contained in:
Nicolás Sánchez 2025-09-01 13:52:03 -03:00
parent f5e5f4eb77
commit a5efd6e992
3 changed files with 13 additions and 10 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ logs/gateio.log
logs/kucoin.log logs/kucoin.log
upload_testnet.sh upload_testnet.sh
upload_mainnet.sh upload_mainnet.sh
upload_local_testnet.sh
utils/data/binance.db utils/data/binance.db
utils/data/okx.db utils/data/okx.db
utils/data/gateio.db utils/data/gateio.db

View File

@ -1,3 +1,6 @@
2025.09.01:
. Fixed bug in unwrapped_last_call().
2025.08.19: 2025.08.19:
. Improved log trimming. . Improved log trimming.

19
main.py
View File

@ -18,7 +18,7 @@ import exchange_wrapper
import trader import trader
version = "2025.08.19" version = "2025.09.01"
''' '''
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
@ -1871,16 +1871,15 @@ def unwrapped_last_call(base,quote):
try: try:
symbol = f"{base}/{quote}" symbol = f"{base}/{quote}"
if symbol in broker.get_pairs(): #Why was this? for instance in running_traders:
for instance in running_traders: if symbol==instance.config.get_pair():
if symbol==instance.config.get_pair(): instance.status.set_stop_when_profit(not instance.status.get_stop_when_profit())
instance.status.set_stop_when_profit(not instance.status.get_stop_when_profit()) instance.update_status(True)
if instance.status.get_stop_when_profit():
instance.config.set_autoswitch(False)
instance.update_status(True) instance.update_status(True)
if instance.status.get_stop_when_profit(): return jsonify({"Success": "Trader scheduled to go offline when profit is reached"})
instance.config.set_autoswitch(False) return jsonify({"Success": "Last call cancelled"})
instance.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"}) return jsonify({"Error": "Trader does not exist"})
except Exception: except Exception:
return jsonify({"Error": "Halp"}) return jsonify({"Error": "Halp"})