mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Check if timeframes is available and fail gracefully otherwise
This commit is contained in:
parent
cdeb649d0b
commit
0c7d14fe50
|
@ -269,6 +269,13 @@ class Exchange(object):
|
|||
"""
|
||||
Checks if ticker interval from config is a supported timeframe on the exchange
|
||||
"""
|
||||
logger.warning("validate_timerames")
|
||||
if not hasattr(self._api, "timeframes"):
|
||||
# If timeframes is missing, the exchange probably has no fetchOHLCV method.
|
||||
# Therefore we also show that.
|
||||
raise OperationalException(
|
||||
f"This exchange ({self.name}) does not have a `timeframes` attribute and "
|
||||
f"is therefore not supported. fetchOHLCV: {self.exchange_has('fetchOHLCV')}")
|
||||
timeframes = self._api.timeframes
|
||||
if timeframe not in timeframes:
|
||||
raise OperationalException(
|
||||
|
|
|
@ -28,6 +28,7 @@ class ExchangeResolver(IResolver):
|
|||
except ImportError:
|
||||
logger.info(
|
||||
f"No {exchange_name} specific subclass found. Using the generic class instead.")
|
||||
if not hasattr(self, "exchange"):
|
||||
self.exchange = Exchange(config)
|
||||
|
||||
def _load_exchange(
|
||||
|
|
Loading…
Reference in New Issue
Block a user