From 2b7405470aebf4860c2fb50b76236399f4483aab Mon Sep 17 00:00:00 2001 From: Rokas Kupstys Date: Sat, 15 Jan 2022 17:30:20 +0200 Subject: [PATCH] Fix timerange check. --- freqtrade/optimize/backtesting.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 950531637..398a35893 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -753,7 +753,8 @@ class Backtesting: } # Load previous result that will be updated incrementally. - if self.config.get('timerange', '-').endswith('-'): + if self.timerange.stopts == 0 or datetime.fromtimestamp( + self.timerange.stopts, tz=timezone.utc) > datetime.now(tz=timezone.utc): self.config['no_backtest_cache'] = True logger.warning('Backtest result caching disabled due to use of open-ended timerange.')