From ad28543d4d7f68f003eca3c676a0daced11c3658 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 22 Jan 2022 11:04:58 +0100 Subject: [PATCH] Update kraken calculation --- freqtrade/exchange/kraken.py | 2 +- freqtrade/optimize/backtesting.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/kraken.py b/freqtrade/exchange/kraken.py index 10535a909..7c67d870d 100644 --- a/freqtrade/exchange/kraken.py +++ b/freqtrade/exchange/kraken.py @@ -191,4 +191,4 @@ class Kraken(Exchange): df = df[(df['date'] >= open_date) & (df['date'] <= close_date)] fees = sum(df['open_fund'] * df['open_mark'] * amount * time_in_ratio) - return fees + return fees if is_short else -fees diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index bedb83d1a..7e6aa3ce5 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -492,6 +492,7 @@ class Backtesting: sell_candle_time: datetime = sell_row[DATE_IDX].to_pydatetime() if self.trading_mode == TradingMode.FUTURES: + # TODO-lev: Other fees / liquidation price? trade.funding_fees = self.exchange.calculate_funding_fees( self.futures_data[trade.pair], amount=trade.amount,