Properly handle and test ohlcv min_max with empty files

This commit is contained in:
Matthias
2022-11-05 13:14:35 +01:00
parent a9ea84e2c4
commit 6e09d552ac
2 changed files with 23 additions and 0 deletions

View File

@@ -102,6 +102,11 @@ class IDataHandler(ABC):
:return: (min, max)
"""
data = self._ohlcv_load(pair, timeframe, None, candle_type)
if data.empty:
return (
datetime.fromtimestamp(0, tz=timezone.utc),
datetime.fromtimestamp(0, tz=timezone.utc)
)
return data.iloc[0]['date'].to_pydatetime(), data.iloc[-1]['date'].to_pydatetime()
@abstractmethod