diff --git a/freqtrade/plugins/pairlist/SpreadFilter.py b/freqtrade/plugins/pairlist/SpreadFilter.py index ecb21593b..207328d08 100644 --- a/freqtrade/plugins/pairlist/SpreadFilter.py +++ b/freqtrade/plugins/pairlist/SpreadFilter.py @@ -5,7 +5,6 @@ import logging from typing import Any, Dict, Optional from freqtrade.constants import Config -from freqtrade.exceptions import OperationalException from freqtrade.exchange.types import Ticker from freqtrade.plugins.pairlist.IPairList import IPairList @@ -23,12 +22,6 @@ class SpreadFilter(IPairList): self._max_spread_ratio = pairlistconfig.get('max_spread_ratio', 0.005) self._enabled = self._max_spread_ratio != 0 - if not self._exchange.exchange_has('fetchTickers'): - raise OperationalException( - 'Exchange does not support fetchTickers, therefore SpreadFilter cannot be used.' - 'Please edit your config and restart the bot.' - ) - @property def needstickers(self) -> bool: """ diff --git a/freqtrade/plugins/pairlistmanager.py b/freqtrade/plugins/pairlistmanager.py index 1e98b8485..20a264fd8 100644 --- a/freqtrade/plugins/pairlistmanager.py +++ b/freqtrade/plugins/pairlistmanager.py @@ -46,6 +46,15 @@ class PairListManager(LoggingMixin): if not self._pairlist_handlers: raise OperationalException("No Pairlist Handlers defined") + if self._tickers_needed and not self._exchange.exchange_has('fetchTickers'): + invalid = ". ".join([p.name for p in self._pairlist_handlers if p.needstickers]) + + raise OperationalException( + "Exchange does not support fetchTickers, therefore the following pairlists " + "cannot be used. Please edit your config and restart the bot.\n" + f"{invalid}." + ) + refresh_period = config.get('pairlist_refresh_period', 3600) LoggingMixin.__init__(self, logger, refresh_period)