Compare commits
2 Commits
415f74fe3e
...
0b1cc99558
| Author | SHA1 | Date |
|---|---|---|
|
|
0b1cc99558 | |
|
|
39506b3afc |
|
|
@ -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.
|
||||
|
|
|
|||
2
main.py
2
main.py
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue