fixed partial profit reset mkII

This commit is contained in:
Nicolás Sánchez 2025-08-31 23:22:25 -03:00
parent 559b95819a
commit 433813115f
1 changed files with 1 additions and 1 deletions

View File

@ -943,7 +943,7 @@ class trader:
#self.status.set_base_bought(old_tp_order["remaining"])
# Partial profit calculation
if not self.config.get_is_short():
current_deal_price = self.status.get_base_bought()/self.status.get_quote_spent()
current_deal_price = self.status.get_quote_spent()/self.status.get_base_bought()
self.status.set_partial_profit(self.status.get_partial_profit()+old_tp_order["cost"]-(old_tp_order["filled"]*current_deal_price)-self.parse_fees(old_tp_order)[1])
self.update_status(True)
self.status.set_base_bought(self.status.get_base_bought() - old_tp_order["filled"] - self.parse_fees(old_tp_order)[0])