Compare commits

...

2 Commits

Author SHA1 Message Date
Nicolás Sánchez 0b1cc99558 2025.05.18 2025-05-20 18:56:40 -03:00
Nicolás Sánchez 39506b3afc modified exchange name 2025-05-19 19:37:11 -03:00
4 changed files with 6 additions and 4 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)

View File

@ -10,7 +10,7 @@ with open(f"../configs/{sys.argv[1]}.json") as k:
pwd = config["password"] if "password" in config else ""
exch = sys.argv[1]
if exch=="okex":
exch="okex5"
exch="okx"
exchange_class = getattr(ccxt, sys.argv[1])
exchange = exchange_class({
"apiKey": config["key"],