From 1e3af792ac75dd22f1c341d5623eb7ed67bbfad8 Mon Sep 17 00:00:00 2001 From: Joe Schr Date: Thu, 8 Apr 2021 18:45:15 +0200 Subject: [PATCH] fix: using whole data instead of timerange --- freqtrade/data/converter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/freqtrade/data/converter.py b/freqtrade/data/converter.py index c9d4ef19f..a760bbe71 100644 --- a/freqtrade/data/converter.py +++ b/freqtrade/data/converter.py @@ -132,13 +132,12 @@ def trim_dataframe(df: DataFrame, timerange, df_date_col: str = 'date', :param startup_candles: When not 0, is used instead the timerange start date :return: trimmed dataframe """ + if timerange.starttype == 'date': + start = datetime.fromtimestamp(timerange.startts, tz=timezone.utc) + df = df.loc[df[df_date_col] >= start, :] if startup_candles: # Trim candles instead of timeframe in case of given startup_candle count df = df.iloc[startup_candles:, :] - else: - if timerange.starttype == 'date': - start = datetime.fromtimestamp(timerange.startts, tz=timezone.utc) - df = df.loc[df[df_date_col] >= start, :] if timerange.stoptype == 'date': stop = datetime.fromtimestamp(timerange.stopts, tz=timezone.utc) df = df.loc[df[df_date_col] <= stop, :]