2025.09.12
This commit is contained in:
parent
37661d91eb
commit
73eff21dbb
|
|
@ -1,3 +1,7 @@
|
||||||
|
2025.09.12:
|
||||||
|
. No retries when sending a cleanup order.
|
||||||
|
. Removed redundant try...except blocks in switch_to_long.
|
||||||
|
|
||||||
2025.09.11:
|
2025.09.11:
|
||||||
. Fixed bug in start_trader that called amount_to_precision with very low amounts and spammed logs.
|
. Fixed bug in start_trader that called amount_to_precision with very low amounts and spammed logs.
|
||||||
|
|
||||||
|
|
|
||||||
2
main.py
2
main.py
|
|
@ -18,7 +18,7 @@ import exchange_wrapper
|
||||||
import trader
|
import trader
|
||||||
|
|
||||||
|
|
||||||
version = "2025.09.11"
|
version = "2025.09.12"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -449,7 +449,7 @@ class trader:
|
||||||
if balance_to_clean >= min_base_size:
|
if balance_to_clean >= min_base_size:
|
||||||
self.broker.logger.log_this(f"Balance to clean: {balance_to_clean} {self.base}",2,self.status.get_pair())
|
self.broker.logger.log_this(f"Balance to clean: {balance_to_clean} {self.base}",2,self.status.get_pair())
|
||||||
self.broker.logger.log_this("Sending cleanup order...",2,self.status.get_pair())
|
self.broker.logger.log_this("Sending cleanup order...",2,self.status.get_pair())
|
||||||
cleanup_order = self.broker.new_limit_order(self.status.get_pair(),balance_to_clean,"sell",self.status.get_take_profit_price())
|
cleanup_order = self.broker.new_limit_order(self.status.get_pair(),balance_to_clean,"sell",self.status.get_take_profit_price(),no_retries=True)
|
||||||
if cleanup_order is None:
|
if cleanup_order is None:
|
||||||
self.broker.logger.log_this("Problems with the cleanup order, new_limit_order returned None",1,self.status.get_pair())
|
self.broker.logger.log_this("Problems with the cleanup order, new_limit_order returned None",1,self.status.get_pair())
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -620,18 +620,12 @@ class trader:
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
#Cancel open orders
|
#Cancel open orders
|
||||||
try:
|
|
||||||
for order in self.status.get_safety_orders():
|
for order in self.status.get_safety_orders():
|
||||||
self.broker.cancel_order(order["id"],self.status.get_pair())
|
self.broker.cancel_order(order["id"],self.status.get_pair())
|
||||||
except Exception as e:
|
|
||||||
self.broker.logger.log_this(f"Error in cancel_order while cancelling safety order. Exception: {e}",1,self.status.get_pair())
|
|
||||||
try:
|
|
||||||
if self.status.get_take_profit_order() is not None:
|
if self.status.get_take_profit_order() is not None:
|
||||||
self.broker.cancel_order(self.status.get_take_profit_order()["id"],self.status.get_pair())
|
self.broker.cancel_order(self.status.get_take_profit_order()["id"],self.status.get_pair())
|
||||||
else:
|
else:
|
||||||
self.broker.logger.log_this("Safety order is None",1,self.status.get_pair())
|
self.broker.logger.log_this("Safety order is None",1,self.status.get_pair())
|
||||||
except Exception as e:
|
|
||||||
self.broker.logger.log_this(f"Error in cancel_order while cancelling take profit order. Exception: {e}",1,self.status.get_pair())
|
|
||||||
|
|
||||||
#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)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue