Also check candle_type_def when creating the pairlist and getting the ohlcv.

This commit is contained in:
Wade Dyck 2021-12-27 16:51:02 -07:00
parent 5743b3a0b7
commit a26c82b7cc
2 changed files with 10 additions and 2 deletions

View File

@ -139,4 +139,10 @@ class PairListManager():
"""
Create list of pair tuples with (pair, timeframe)
"""
return [(pair, timeframe or self._config['timeframe'], CandleType.SPOT) for pair in pairs]
return [
(
pair,
timeframe or self._config['timeframe'],
self._config.get('candle_type_def', CandleType.SPOT)
) for pair in pairs
]

View File

@ -564,7 +564,9 @@ class IStrategy(ABC, HyperStrategyMixin):
"""
if not self.dp:
raise OperationalException("DataProvider not found.")
dataframe = self.dp.ohlcv(pair, self.timeframe)
dataframe = self.dp.ohlcv(
pair, self.timeframe, candle_type=self.config.get('candle_type_def', CandleType.SPOT)
)
if not isinstance(dataframe, DataFrame) or dataframe.empty:
logger.warning('Empty candle (OHLCV) data for pair %s', pair)
return