diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 57fdc4a14..c391dcb5c 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -198,8 +198,8 @@ def _download_pair_history(pair: str, *, try: logger.info( - f'Download history data for pair: "{pair}" ({process}), timeframe: {timeframe} ' - f'and store in {datadir}.' + f'Download history data for pair: "{pair}" ({process}), timeframe: {timeframe}, ' + f'candle type: {candle_type} and store in {datadir}.' ) # data, since_ms = _load_cached_data_for_updating_old(datadir, pair, timeframe, timerange) @@ -286,17 +286,17 @@ def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes fr_candle_type = CandleType.from_string(exchange._ft_has['mark_ohlcv_price']) # All exchanges need FundingRate for futures trading. # The timeframe is aligned to the mark-price timeframe. - for candle_type in (CandleType.FUNDING_RATE, fr_candle_type): + for funding_candle_type in (CandleType.FUNDING_RATE, fr_candle_type): # TODO: this could be in most parts to the above. if erase: - if data_handler.ohlcv_purge(pair, timeframe, candle_type=candle_type): + if data_handler.ohlcv_purge(pair, timeframe, candle_type=funding_candle_type): logger.info( f'Deleting existing data for pair {pair}, interval {timeframe}.') _download_pair_history(pair=pair, process=process, datadir=datadir, exchange=exchange, timerange=timerange, data_handler=data_handler, timeframe=str(timeframe), new_pairs_days=new_pairs_days, - candle_type=candle_type) + candle_type=funding_candle_type) return pairs_not_available diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 3fe9a55f8..caf568faf 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -196,6 +196,7 @@ class Backtesting: startup_candles=self.required_startup, fail_without_data=True, data_format=self.config.get('dataformat_ohlcv', 'json'), + candle_type=self.config.get('candle_type_def', CandleType.SPOT) ) min_date, max_date = history.get_timerange(data) @@ -224,6 +225,7 @@ class Backtesting: startup_candles=0, fail_without_data=True, data_format=self.config.get('dataformat_ohlcv', 'json'), + candle_type=self.config.get('candle_type_def', CandleType.SPOT) ) else: self.detail_data = {} diff --git a/tests/data/test_history.py b/tests/data/test_history.py index d70d69080..351ae9919 100644 --- a/tests/data/test_history.py +++ b/tests/data/test_history.py @@ -148,8 +148,8 @@ def test_load_data_with_new_pair_1min(ohlcv_history_list, mocker, caplog, load_pair_history(datadir=tmpdir1, timeframe='1m', pair='MEME/BTC', candle_type=candle_type) assert file.is_file() assert log_has_re( - r'Download history data for pair: "MEME/BTC" \(0/1\), timeframe: 1m ' - r'and store in .*', caplog + r'Download history data for pair: "MEME/BTC" \(0/1\), timeframe: 1m, ' + r'candle type: spot and store in .*', caplog )