From 14908e52e2fc864dbbacfb42157197f7d7c4adea Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 8 Oct 2023 20:39:25 +0200 Subject: [PATCH] Improv variable naming --- freqtrade/exchange/exchange.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 7ec31d5f8..4ef6b5e0b 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -2655,6 +2655,8 @@ class Exchange: def funding_fee_cutoff(self, open_date: datetime): """ + Funding fees are only charged at full hours (usually every 4-8h). + Therefore a trade opening at 10:00:01 will not be charged a funding fee until the next hour. :param open_date: The open date for a trade :return: The cutoff open time for when a funding fee is charged """ @@ -2796,8 +2798,8 @@ class Exchange: fees: float = 0 if not df.empty: - df = df[(df['date'] >= open_date) & (df['date'] <= close_date)] - fees = sum(df['open_fund'] * df['open_mark'] * amount) + df1 = df[(df['date'] >= open_date) & (df['date'] <= close_date)] + fees = sum(df1['open_fund'] * df1['open_mark'] * amount) # Negate fees for longs as funding_fees expects it this way based on live endpoints. return fees if is_short else -fees