From 5b3f907b0cdb4c04d57810c811726872e066d27f Mon Sep 17 00:00:00 2001 From: Wade Dyck Date: Mon, 27 Dec 2021 11:16:38 -0700 Subject: [PATCH] Fixes a download_data bug when in futures mode. When specifying multiple pairs to download, the json filenames were inconsistent due to the reassignment of candle_type. Also adds the candle_type being downloaded to a log message. --- freqtrade/data/history/history_utils.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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