Fix timerange check.

This commit is contained in:
Rokas Kupstys 2022-01-15 17:30:20 +02:00
parent 9becce9897
commit 2b7405470a

View File

@ -753,7 +753,8 @@ class Backtesting:
} }
# Load previous result that will be updated incrementally. # 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 self.config['no_backtest_cache'] = True
logger.warning('Backtest result caching disabled due to use of open-ended timerange.') logger.warning('Backtest result caching disabled due to use of open-ended timerange.')