2025.07.21

This commit is contained in:
Nicolás Sánchez 2025-07-21 16:18:06 -03:00
parent 18ff158b1d
commit e49945ddbc
3 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2025.07.21:
. Corrected an error in switch_to_long.
2025.07.18: 2025.07.18:
. Changed Waitress' logging level to ERROR. . Changed Waitress' logging level to ERROR.

View File

@ -16,7 +16,7 @@ import exchange_wrapper
import trader import trader
version = "2025.07.18" version = "2025.07.21"
''' '''
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

View File

@ -633,6 +633,10 @@ class trader:
#Sell all base currency #Sell all base currency
self.liquidate_base(ignore_profits=ignore_old_long, already_received_quote=already_received_quote) self.liquidate_base(ignore_profits=ignore_old_long, already_received_quote=already_received_quote)
if self.config.get_liquidate_after_switch():
self.quit = True
return 1
#Rewrite config file (if it exists) #Rewrite config file (if it exists)
if os.path.isfile(f"configs/{self.base}{self.quote}.bak") and os.path.isfile(f"configs/{self.base}{self.quote}.json"): if os.path.isfile(f"configs/{self.base}{self.quote}.bak") and os.path.isfile(f"configs/{self.base}{self.quote}.json"):
with open(f"configs/{self.base}{self.quote}.bak") as c: with open(f"configs/{self.base}{self.quote}.bak") as c:
@ -1001,9 +1005,7 @@ class trader:
#Sell all base (market), report the profits and restart the trader #Sell all base (market), report the profits and restart the trader
self.status.set_pause_reason("automatic_switch") self.status.set_pause_reason("automatic_switch")
self.switch_to_long(already_received_quote=self.status.get_quote_spent()) self.switch_to_long(already_received_quote=self.status.get_quote_spent())
if self.config.get_liquidate_after_switch(): if not self.config.get_liquidate_after_switch():
self.quit = True
else:
self.restart = True self.restart = True
return 1 return 1