Skip to content

Commit

Permalink
Don't update liquidation price for closed trades
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Mar 29, 2023
1 parent a642524 commit 8a49d62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ def update_trade_state(
# TODO: should shorting/leverage be supported by Edge,
# then this will need to be fixed.
trade.adjust_stop_loss(trade.open_rate, self.strategy.stoploss, initial=True)
if order.get('side') == trade.entry_side or trade.amount > 0:
if order.get('side') == trade.entry_side or (trade.amount > 0 and trade.is_open):
# Must also run for partial exits
# TODO: Margin will need to use interest_rate as well.
# interest_rate = self.exchange.get_interest_rate()
Expand Down

0 comments on commit 8a49d62

Please sign in to comment.