2025.05.18

This commit is contained in:
Nicolás Sánchez 2025-05-20 18:56:40 -03:00
parent 39506b3afc
commit 0b1cc99558
3 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,6 @@
2025.05.18:
. In start_trader, missing base is calculated using amount_to_precision.
2025.05.16:
. Added exception handling when removing a trader.
. Minor variable renaming.

View File

@ -16,7 +16,7 @@ import exchange_wrapper
import trader
version = "2025.05.16"
version = "2025.05.18"
'''
Color definitions. If you want to change them, check the reference at https://en.wikipedia.org/wiki/ANSI_escape_code#Colors

View File

@ -129,9 +129,8 @@ class trader:
#Buy missing base sold because of rounding errors (rare)
if self.status.get_old_long()!={}:
diff = self.status.get_old_long()["tp_amount"] - free_base
diff = self.broker.amount_to_precision(self.config.get_pair(), self.status.get_old_long()["tp_amount"] - free_base)
if diff>min_base_size:
diff = self.broker.amount_to_precision(self.config.get_pair(),diff)
self.broker.logger.log_this(f"Buying missing {diff} {self.base}",1,self.config.get_pair())
self.broker.new_market_order(self.config.get_pair(),diff,"buy",amount_in_base=True)
time.sleep(self.broker.get_wait_time()*2)