fixed partial profit reset

This commit is contained in:
Nicolás Sánchez 2025-08-31 21:51:48 -03:00
parent e88ed99d6b
commit 559b95819a
1 changed files with 3 additions and 0 deletions

View File

@ -756,6 +756,9 @@ class trader:
else: else:
profit = filled_order["cost"]-self.status.get_quote_spent()-self.status.get_fees_paid_in_quote()-self.parse_fees(filled_order)[1] profit = filled_order["cost"]-self.status.get_quote_spent()-self.status.get_fees_paid_in_quote()-self.parse_fees(filled_order)[1]
profit+=self.status.get_partial_profit() profit+=self.status.get_partial_profit()
#Reset partial profit
self.status.set_partial_profit(0)
#Checks if some base was left over. #Checks if some base was left over.
base_profit = max(self.status.get_base_bought()-filled_order["filled"],0) #To avoid negative numbers in base_profit base_profit = max(self.status.get_base_bought()-filled_order["filled"],0) #To avoid negative numbers in base_profit