From ac2fb08aead572125bad259dd97b66977dcc2866 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 7 Dec 2021 20:21:49 +0100 Subject: [PATCH] Small updates while reviewing --- freqtrade/data/history/history_utils.py | 6 ++---- freqtrade/strategy/informative_decorator.py | 1 + freqtrade/strategy/interface.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/freqtrade/data/history/history_utils.py b/freqtrade/data/history/history_utils.py index 0970c0e95..793c8b839 100644 --- a/freqtrade/data/history/history_utils.py +++ b/freqtrade/data/history/history_utils.py @@ -270,8 +270,7 @@ def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes if erase: if data_handler.ohlcv_purge(pair, timeframe, candle_type=candle_type): - logger.info( - f'Deleting existing data for pair {pair}, interval {timeframe}.') + logger.info(f'Deleting existing data for pair {pair}, interval {timeframe}.') logger.info(f'Downloading pair {pair}, interval {timeframe}.') process = f'{idx}/{len(pairs)}' @@ -290,8 +289,7 @@ def refresh_backtest_ohlcv_data(exchange: Exchange, pairs: List[str], timeframes # TODO: this could be in most parts to the above. if erase: if data_handler.ohlcv_purge(pair, timeframe, candle_type=candle_type): - logger.info( - f'Deleting existing data for pair {pair}, interval {timeframe}.') + 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, diff --git a/freqtrade/strategy/informative_decorator.py b/freqtrade/strategy/informative_decorator.py index 3d939e017..2085630cb 100644 --- a/freqtrade/strategy/informative_decorator.py +++ b/freqtrade/strategy/informative_decorator.py @@ -57,6 +57,7 @@ def informative(timeframe: str, asset: str = '', def decorator(fn: PopulateIndicators): informative_pairs = getattr(fn, '_ft_informative', []) + # TODO-lev: Add candle_type to InformativeData informative_pairs.append(InformativeData(_asset, _timeframe, _fmt, _ffill)) setattr(fn, '_ft_informative', informative_pairs) return fn diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 2a3b4e754..7c3fd60f1 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -530,7 +530,7 @@ class IStrategy(ABC, HyperStrategyMixin): dataframe = self.analyze_ticker(dataframe, metadata) self._last_candle_seen_per_pair[pair] = dataframe.iloc[-1]['date'] if self.dp: - self.dp._set_cached_df(pair, self.timeframe, dataframe, CandleType.SPOT) + self.dp._set_cached_df(pair, self.timeframe, dataframe, CandleType.SPOT_) # TODO-lev: CandleType should be set conditionally else: logger.debug("Skipping TA Analysis for already analyzed candle")