2025.09.24
This commit is contained in:
parent
171738fa4d
commit
9e2a1dc7a1
|
|
@ -1,3 +1,8 @@
|
||||||
|
2025.09.24:
|
||||||
|
. Added a new config option: wait_after_initial_market_order. If specifies in seconds the amount of wait time after sending the initial market order.
|
||||||
|
It should help the exchanges to report correctly the recently filled market order.
|
||||||
|
. Removed the "PAUSED" notice in the screen output that was unused.
|
||||||
|
|
||||||
2025.09.21:
|
2025.09.21:
|
||||||
. Fixed a bug that caused short traders to have an incorrect order size.
|
. Fixed a bug that caused short traders to have an incorrect order size.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ class Broker:
|
||||||
#Default values
|
#Default values
|
||||||
self.wait_time = self.broker_config.get("wait_time",.5)
|
self.wait_time = self.broker_config.get("wait_time",.5)
|
||||||
self.cooldown_multiplier = self.broker_config.get("cooldown_multiplier",2)
|
self.cooldown_multiplier = self.broker_config.get("cooldown_multiplier",2)
|
||||||
|
self.wait_after_initial_market_order = self.broker_config.get("wait_after_initial_market_order",2)
|
||||||
self.wait_before_new_safety_order = self.broker_config.get("wait_before_new_safety_order",1)
|
self.wait_before_new_safety_order = self.broker_config.get("wait_before_new_safety_order",1)
|
||||||
self.retries = self.broker_config.get("retries",5)
|
self.retries = self.broker_config.get("retries",5)
|
||||||
self.slippage_default_threshold = self.broker_config.get("slippage_default_threshold",.03)
|
self.slippage_default_threshold = self.broker_config.get("slippage_default_threshold",.03)
|
||||||
|
|
@ -192,6 +193,13 @@ class Broker:
|
||||||
self.cooldown_multiplier = value
|
self.cooldown_multiplier = value
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def get_wait_after_initial_market_order(self):
|
||||||
|
return self.wait_after_initial_market_order
|
||||||
|
|
||||||
|
def set_wait_after_initial_market_order(self, value:float):
|
||||||
|
self.wait_after_initial_market_order = value
|
||||||
|
return 0
|
||||||
|
|
||||||
def get_wait_before_new_safety_order(self):
|
def get_wait_before_new_safety_order(self):
|
||||||
return self.wait_before_new_safety_order
|
return self.wait_before_new_safety_order
|
||||||
|
|
||||||
|
|
|
||||||
2
main.py
2
main.py
|
|
@ -18,7 +18,7 @@ import exchange_wrapper
|
||||||
import trader
|
import trader
|
||||||
|
|
||||||
|
|
||||||
version = "2025.09.21"
|
version = "2025.09.24"
|
||||||
|
|
||||||
'''
|
'''
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ class trader:
|
||||||
#Wait a bit longer, sometimes a recently filled market order is not updated quickly enough.
|
#Wait a bit longer, sometimes a recently filled market order is not updated quickly enough.
|
||||||
# When that happens, the amount of base taken into account by the trader is lower than the amount bought,
|
# When that happens, the amount of base taken into account by the trader is lower than the amount bought,
|
||||||
# which ends up misrepresenting the trade cost per unit of base, which causes the take profit price to skyrocket.
|
# which ends up misrepresenting the trade cost per unit of base, which causes the take profit price to skyrocket.
|
||||||
time.sleep(self.broker.get_wait_time()*2)
|
time.sleep(self.broker.get_wait_after_initial_market_order())
|
||||||
returned_order = self.broker.get_order(first_order["id"],self.status.get_pair())
|
returned_order = self.broker.get_order(first_order["id"],self.status.get_pair())
|
||||||
if returned_order==self.broker.get_empty_order():
|
if returned_order==self.broker.get_empty_order():
|
||||||
self.broker.logger.log_this("Problems with the initial order",1,self.status.get_pair())
|
self.broker.logger.log_this("Problems with the initial order",1,self.status.get_pair())
|
||||||
|
|
@ -1619,7 +1619,6 @@ class trader:
|
||||||
line3 = ""
|
line3 = ""
|
||||||
if self.status.get_base_bought()!=0:
|
if self.status.get_base_bought()!=0:
|
||||||
line3 = draw_line(mid_price,low_price,high_price,self.status.get_quote_spent()/self.status.get_base_bought())
|
line3 = draw_line(mid_price,low_price,high_price,self.status.get_quote_spent()/self.status.get_base_bought())
|
||||||
p = "*PAUSED*" if self.pause==True else ""
|
|
||||||
low_boundary_color = self.get_color("red")
|
low_boundary_color = self.get_color("red")
|
||||||
price_color = self.get_color("white")
|
price_color = self.get_color("white")
|
||||||
target_price_color = self.get_color("green")
|
target_price_color = self.get_color("green")
|
||||||
|
|
@ -1659,7 +1658,7 @@ class trader:
|
||||||
|
|
||||||
safety_order_string = f"{self.status.get_safety_orders_filled()}/{self.get_color('cyan')}{concurrent_so_amount}{self.get_color('white')}/{self.status.get_no_of_safety_orders()}".rjust(27)
|
safety_order_string = f"{self.status.get_safety_orders_filled()}/{self.get_color('cyan')}{concurrent_so_amount}{self.get_color('white')}/{self.status.get_no_of_safety_orders()}".rjust(27)
|
||||||
prices = f"{low_boundary_color}{low_boundary}{self.get_color('white')}|{price_color}{mid_boundary}{self.get_color('white')}|{target_price_color}{high_boundary}{self.get_color('white')}|{pct_color}{pct_to_profit_str}%{self.get_color('white')}"
|
prices = f"{low_boundary_color}{low_boundary}{self.get_color('white')}|{price_color}{mid_boundary}{self.get_color('white')}|{target_price_color}{high_boundary}{self.get_color('white')}|{pct_color}{pct_to_profit_str}%{self.get_color('white')}"
|
||||||
line1 = f"{p}{pair_color}{self.status.get_pair().center(13)}{self.get_color('white')}| {safety_order_string} |{prices}| Uptime: {self.seconds_to_time(self.status.get_deal_uptime())}"
|
line1 = f"{pair_color}{self.status.get_pair().center(13)}{self.get_color('white')}| {safety_order_string} |{prices}| Uptime: {self.seconds_to_time(self.status.get_deal_uptime())}"
|
||||||
if self.status.get_is_boosted():
|
if self.status.get_is_boosted():
|
||||||
line1 = f"{line1} | BOOSTED"
|
line1 = f"{line1} | BOOSTED"
|
||||||
if self.config.get_autoswitch():
|
if self.config.get_autoswitch():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue