205.09.25

This commit is contained in:
Nicolás Sánchez 2025-09-25 18:07:58 -03:00
parent 9e2a1dc7a1
commit 65c406a03d
3 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2025.09.25:
. Added a pause after getting filled orders in check_status.
. Added an extra logging line in take_profit_routine.
2025.09.24: 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. . 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. It should help the exchanges to report correctly the recently filled market order.

View File

@ -18,7 +18,7 @@ import exchange_wrapper
import trader import trader
version = "2025.09.24" version = "2025.09.25"
''' '''
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

View File

@ -197,6 +197,10 @@ class trader:
#Sending initial order #Sending initial order
#
# Here, if the amount of the initial order is already available in the account, don't send a market order; just pull the current price and simulate that the order was sent and filled.
# Cleanup probably would have to be disabled for this to make sense.
#
self.status.set_pause_reason("start_trader - sending first order") self.status.set_pause_reason("start_trader - sending first order")
self.broker.logger.log_this("Sending first order...",2,self.status.get_pair()) self.broker.logger.log_this("Sending first order...",2,self.status.get_pair())
action = "sell" if self.config.get_is_short() else "buy" action = "sell" if self.config.get_is_short() else "buy"
@ -789,6 +793,7 @@ class trader:
partial_profit = market_order["cost"]-(avg_buy_price*partial_filled_amount)-self.parse_fees(market_order)[1] partial_profit = market_order["cost"]-(avg_buy_price*partial_filled_amount)-self.parse_fees(market_order)[1]
self.status.set_partial_profit(self.status.get_partial_profit()+partial_profit) self.status.set_partial_profit(self.status.get_partial_profit()+partial_profit)
break break
self.broker.logger.log_this("Waiting for partial fill sell order to fill.",1,self.status.get_pair())
tries-=1 tries-=1
time.sleep(self.broker.get_wait_time()) time.sleep(self.broker.get_wait_time())
if tries==0: if tries==0:
@ -1186,6 +1191,7 @@ class trader:
filled_orders = [] filled_orders = []
for id in filled_ids: for id in filled_ids:
order = self.broker.get_order(id, self.status.get_pair()) order = self.broker.get_order(id, self.status.get_pair())
time.sleep(self.broker.get_wait_time())
if order["status"]=="closed": if order["status"]=="closed":
filled_orders.append(order) filled_orders.append(order)
if len(filled_orders)>0: #To make sure that the safety orders are actually filled (Kucoin sometimes sends incomplete order lists) if len(filled_orders)>0: #To make sure that the safety orders are actually filled (Kucoin sometimes sends incomplete order lists)