From 08c10c1f9b51ed162bd4fbc2c0f568e4f82f7811 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 12 Aug 2024 12:34:51 +0200 Subject: [PATCH] chore: exclude right boundary from parallelism test --- freqtrade/data/btanalysis.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/freqtrade/data/btanalysis.py b/freqtrade/data/btanalysis.py index 2895b4181..a237b10f1 100644 --- a/freqtrade/data/btanalysis.py +++ b/freqtrade/data/btanalysis.py @@ -401,7 +401,15 @@ def analyze_trade_parallelism(results: pd.DataFrame, timeframe: str) -> pd.DataF timeframe_freq = timeframe_to_resample_freq(timeframe) dates = [ - pd.Series(pd.date_range(row[1]["open_date"], row[1]["close_date"], freq=timeframe_freq)) + pd.Series( + pd.date_range( + row[1]["open_date"], + row[1]["close_date"], + freq=timeframe_freq, + # Exclude right boundary - the date is the candle open date. + inclusive="left", + ) + ) for row in results[["open_date", "close_date"]].iterrows() ] deltas = [len(x) for x in dates]