diff --git a/freqtrade/data/history/hdf5datahandler.py b/freqtrade/data/history/hdf5datahandler.py index 1aa7f2883..b91e9c608 100644 --- a/freqtrade/data/history/hdf5datahandler.py +++ b/freqtrade/data/history/hdf5datahandler.py @@ -21,29 +21,6 @@ class HDF5DataHandler(IDataHandler): _columns = DEFAULT_DATAFRAME_COLUMNS - @classmethod - def ohlcv_get_available_data( - cls, datadir: Path, trading_mode: TradingMode) -> ListPairsWithTimeframes: - """ - Returns a list of all pairs with ohlcv data available in this datadir - :param datadir: Directory to search for ohlcv files - :param trading_mode: trading-mode to be used - :return: List of Tuples of (pair, timeframe, CandleType) - """ - if trading_mode == TradingMode.FUTURES: - datadir = datadir.joinpath('futures') - _tmp = [ - re.search( - cls._OHLCV_REGEX, p.name - ) for p in datadir.glob("*.h5") - ] - return [ - ( - cls.rebuild_pair_from_filename(match[1]), - cls.rebuild_timeframe_from_filename(match[2]), - CandleType.from_string(match[3]) - ) for match in _tmp if match and len(match.groups()) > 1] - @classmethod def ohlcv_get_pairs(cls, datadir: Path, timeframe: str, candle_type: CandleType) -> List[str]: """ diff --git a/freqtrade/data/history/idatahandler.py b/freqtrade/data/history/idatahandler.py index 17ee0918e..eb2441abe 100644 --- a/freqtrade/data/history/idatahandler.py +++ b/freqtrade/data/history/idatahandler.py @@ -39,7 +39,6 @@ class IDataHandler(ABC): raise NotImplementedError() @classmethod - @abstractmethod def ohlcv_get_available_data( cls, datadir: Path, trading_mode: TradingMode) -> ListPairsWithTimeframes: """ @@ -48,6 +47,18 @@ class IDataHandler(ABC): :param trading_mode: trading-mode to be used :return: List of Tuples of (pair, timeframe, CandleType) """ + if trading_mode == TradingMode.FUTURES: + datadir = datadir.joinpath('futures') + _tmp = [ + re.search( + cls._OHLCV_REGEX, p.name + ) for p in datadir.glob(f"*.{cls._get_file_extension()}")] + return [ + ( + cls.rebuild_pair_from_filename(match[1]), + cls.rebuild_timeframe_from_filename(match[2]), + CandleType.from_string(match[3]) + ) for match in _tmp if match and len(match.groups()) > 1] @classmethod @abstractmethod diff --git a/freqtrade/data/history/jsondatahandler.py b/freqtrade/data/history/jsondatahandler.py index c000cd15e..9f54f0746 100644 --- a/freqtrade/data/history/jsondatahandler.py +++ b/freqtrade/data/history/jsondatahandler.py @@ -23,28 +23,6 @@ class JsonDataHandler(IDataHandler): _use_zip = False _columns = DEFAULT_DATAFRAME_COLUMNS - @classmethod - def ohlcv_get_available_data( - cls, datadir: Path, trading_mode: TradingMode) -> ListPairsWithTimeframes: - """ - Returns a list of all pairs with ohlcv data available in this datadir - :param datadir: Directory to search for ohlcv files - :param trading_mode: trading-mode to be used - :return: List of Tuples of (pair, timeframe, CandleType) - """ - if trading_mode == 'futures': - datadir = datadir.joinpath('futures') - _tmp = [ - re.search( - cls._OHLCV_REGEX, p.name - ) for p in datadir.glob(f"*.{cls._get_file_extension()}")] - return [ - ( - cls.rebuild_pair_from_filename(match[1]), - cls.rebuild_timeframe_from_filename(match[2]), - CandleType.from_string(match[3]) - ) for match in _tmp if match and len(match.groups()) > 1] - @classmethod def ohlcv_get_pairs(cls, datadir: Path, timeframe: str, candle_type: CandleType) -> List[str]: """