From d559b6d6c685c451e48ca57f7b47f4a6d62f45d3 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Wed, 8 Sep 2021 19:34:54 -0600 Subject: [PATCH] changed add_funding_fees template --- freqtrade/persistence/models.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 1bbc0d296..e15d31d6c 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -16,7 +16,7 @@ from sqlalchemy.sql.schema import UniqueConstraint from freqtrade.constants import DATETIME_PRINT_FORMAT, NON_OPEN_EXCHANGE_STATES from freqtrade.enums import SellType, TradingMode from freqtrade.exceptions import DependencyException, OperationalException -from freqtrade.leverage import funding_fees, interest +from freqtrade.leverage import interest from freqtrade.misc import safe_value_fallback from freqtrade.persistence.migrations import check_migrate @@ -788,13 +788,16 @@ class LocalTrade(): def add_funding_fees(self): if self.trading_mode == TradingMode.FUTURES: - self.funding_fees = funding_fees( - self.exchange, - self.pair, - self.amount, - self.open_date_utc, - self.close_date_utc - ) + # TODO-lev: Calculate this correctly and add it + # if self.config['runmode'].value in ('backtest', 'hyperopt'): + # self.funding_fees = getattr(Exchange, self.exchange).calculate_funding_fees( + # self.exchange, + # self.pair, + # self.amount, + # self.open_date_utc, + # self.close_date_utc + # ) + return @staticmethod def get_trades_proxy(*, pair: str = None, is_open: bool = None,