diff --git a/freqtrade/optimize/__init__.py b/freqtrade/optimize/__init__.py index 3376d0075..e837a09bd 100644 --- a/freqtrade/optimize/__init__.py +++ b/freqtrade/optimize/__init__.py @@ -91,10 +91,11 @@ def validate_backtest_data(data: Dict[str, DataFrame], min_date: datetime, expected_frames = int((max_date - min_date).total_seconds() // 60 // ticker_interval_mins) found_missing = False for pair, df in data.items(): - if len(df) < expected_frames: + dflen = len(df) + if dflen < expected_frames: found_missing = True - logger.warning('%s has missing frames: expected %s, got %s', - pair, expected_frames, len(df)) + logger.warning("%s has missing frames: expected %s, got %s, that's %s missing values", + pair, expected_frames, dflen, expected_frames - dflen) return found_missing diff --git a/freqtrade/tests/optimize/test_optimize.py b/freqtrade/tests/optimize/test_optimize.py index 32db5abd0..2975a3e4b 100644 --- a/freqtrade/tests/optimize/test_optimize.py +++ b/freqtrade/tests/optimize/test_optimize.py @@ -468,8 +468,9 @@ def test_validate_backtest_data_warn(default_conf, mocker, caplog) -> None: assert optimize.validate_backtest_data(data, min_date, max_date, constants.TICKER_INTERVAL_MINUTES["1m"]) assert len(caplog.record_tuples) == 1 - assert log_has('UNITTEST/BTC has missing frames: expected 14396, got 13680', - caplog.record_tuples) + assert log_has( + "UNITTEST/BTC has missing frames: expected 14396, got 13680, that's 716 missing values", + caplog.record_tuples) def test_validate_backtest_data(default_conf, mocker, caplog) -> None: @@ -491,4 +492,3 @@ def test_validate_backtest_data(default_conf, mocker, caplog) -> None: assert not optimize.validate_backtest_data(data, min_date, max_date, constants.TICKER_INTERVAL_MINUTES["5m"]) assert len(caplog.record_tuples) == 0 -