Compare commits
No commits in common. "0b1cc9955892021b03b1b4d9dacbe903cbbbcc16" and "415f74fe3e353a9b6c324772159b8ffccbc502d7" have entirely different histories.
0b1cc99558
...
415f74fe3e
|
|
@ -1,6 +1,3 @@
|
||||||
2025.05.18:
|
|
||||||
. In start_trader, missing base is calculated using amount_to_precision.
|
|
||||||
|
|
||||||
2025.05.16:
|
2025.05.16:
|
||||||
. Added exception handling when removing a trader.
|
. Added exception handling when removing a trader.
|
||||||
. Minor variable renaming.
|
. Minor variable renaming.
|
||||||
|
|
|
||||||
2
main.py
2
main.py
|
|
@ -16,7 +16,7 @@ import exchange_wrapper
|
||||||
import trader
|
import trader
|
||||||
|
|
||||||
|
|
||||||
version = "2025.05.18"
|
version = "2025.05.16"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -129,8 +129,9 @@ class trader:
|
||||||
|
|
||||||
#Buy missing base sold because of rounding errors (rare)
|
#Buy missing base sold because of rounding errors (rare)
|
||||||
if self.status.get_old_long()!={}:
|
if self.status.get_old_long()!={}:
|
||||||
diff = self.broker.amount_to_precision(self.config.get_pair(), self.status.get_old_long()["tp_amount"] - free_base)
|
diff = self.status.get_old_long()["tp_amount"] - free_base
|
||||||
if diff>min_base_size:
|
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.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)
|
self.broker.new_market_order(self.config.get_pair(),diff,"buy",amount_in_base=True)
|
||||||
time.sleep(self.broker.get_wait_time()*2)
|
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 ""
|
pwd = config["password"] if "password" in config else ""
|
||||||
exch = sys.argv[1]
|
exch = sys.argv[1]
|
||||||
if exch=="okex":
|
if exch=="okex":
|
||||||
exch="okx"
|
exch="okex5"
|
||||||
exchange_class = getattr(ccxt, sys.argv[1])
|
exchange_class = getattr(ccxt, sys.argv[1])
|
||||||
exchange = exchange_class({
|
exchange = exchange_class({
|
||||||
"apiKey": config["key"],
|
"apiKey": config["key"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue