fixed partial profit reset mkII
This commit is contained in:
parent
559b95819a
commit
433813115f
|
|
@ -943,7 +943,7 @@ class trader:
|
||||||
#self.status.set_base_bought(old_tp_order["remaining"])
|
#self.status.set_base_bought(old_tp_order["remaining"])
|
||||||
# Partial profit calculation
|
# Partial profit calculation
|
||||||
if not self.config.get_is_short():
|
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.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.update_status(True)
|
||||||
self.status.set_base_bought(self.status.get_base_bought() - old_tp_order["filled"] - self.parse_fees(old_tp_order)[0])
|
self.status.set_base_bought(self.status.get_base_bought() - old_tp_order["filled"] - self.parse_fees(old_tp_order)[0])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue