From 26de992d20636d760adad203464daeeea2ce7db5 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Fri, 5 Aug 2022 12:23:14 +0200 Subject: [PATCH] ensure user sets startup candles in backtesting mode --- freqtrade/optimize/backtesting.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 26519440f..b4675aace 100755 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -208,7 +208,11 @@ class Backtesting: self.progress.init_step(BacktestState.DATALOAD, 1) if self.config.get('freqai') is not None: - self.required_startup += int(self.config.get('freqai', {}).get('startup_candles', 1000)) + startup_candles = int(self.config.get('freqai', {}).get('startup_candles', 0)) + if not startup_candles: + raise OperationalException('FreqAI backtesting module requires user set ' + 'startup_candles in config.') + self.required_startup += int(self.config.get('freqai', {}).get('startup_candles', 0)) logger.info(f'Increasing startup_candle_count for freqai to {self.required_startup}') self.config['startup_candle_count'] = self.required_startup