diff --git a/freqtrade/exchange/exchange_utils.py b/freqtrade/exchange/exchange_utils.py index a33c35d91..e71de992b 100644 --- a/freqtrade/exchange/exchange_utils.py +++ b/freqtrade/exchange/exchange_utils.py @@ -124,6 +124,8 @@ def timeframe_to_resample_freq(timeframe: str) -> str: form ('1m', '5m', '1h', '1d', '1w', etc.) to the resample frequency used by pandas ('1T', '5T', '1H', '1D', '1W', etc.) """ + if timeframe == '1y': + return '1YS' timeframe_seconds = timeframe_to_seconds(timeframe) timeframe_minutes = timeframe_seconds // 60 resample_interval = f'{timeframe_seconds}s' diff --git a/tests/exchange/test_exchange_utils.py b/tests/exchange/test_exchange_utils.py index 50885d493..4e56d4fcf 100644 --- a/tests/exchange/test_exchange_utils.py +++ b/tests/exchange/test_exchange_utils.py @@ -133,6 +133,7 @@ def test_timeframe_to_msecs(): ("1d", '86400s'), ("1w", '604800s'), ("1M", '1MS'), + ("1y", '1YS'), ]) def test_timeframe_to_resample_freq(timeframe, expected): assert timeframe_to_resample_freq(timeframe) == expected