Call funding fee calculation whenever a trade is closed

This commit is contained in:
Matthias 2023-12-10 13:47:43 +01:00
parent ef23f0fcba
commit 8964c138f1

View File

@ -606,6 +606,8 @@ class Backtesting:
"""
if order and self._get_order_filled(order.ft_price, row):
order.close_bt_order(current_date, trade)
self._run_funding_fees(trade, current_date, force=True)
if not (order.ft_order_side == trade.exit_side and order.safe_amount == trade.amount):
# trade is still open
trade.set_liquidation_price(self.exchange.get_liquidation_price(