From 428d451e55f0cc55c1c42ae0dc0b108fb6d079cd Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 29 Sep 2024 09:06:57 +0200 Subject: [PATCH] chore: remove long-deprecated setting --- docs/deprecated.md | 5 ++++- docs/includes/protections.md | 4 ---- freqtrade/configuration/deprecated_settings.py | 4 +++- tests/test_configuration.py | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/deprecated.md b/docs/deprecated.md index 6719ce56d..5357acc62 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -75,7 +75,10 @@ Webhook terminology changed from "sell" to "exit", and from "buy" to "entry", re * `webhooksellfill`, `webhookexitfill` -> `exit_fill` * `webhooksellcancel`, `webhookexitcancel` -> `exit_cancel` - ## Removal of `populate_any_indicators` version 2023.3 saw the removal of `populate_any_indicators` in favor of split methods for feature engineering and targets. Please read the [migration document](strategy_migration.md#freqai-strategy) for full details. + +## Removal of `protections` from configuration + + Setting protections from the configuration via `"protections": [],` has been removed in 2024.10, after having raised deprecation warnings for over 3 years. diff --git a/docs/includes/protections.md b/docs/includes/protections.md index 6fe766c1f..c32846165 100644 --- a/docs/includes/protections.md +++ b/docs/includes/protections.md @@ -11,10 +11,6 @@ All protection end times are rounded up to the next candle to avoid sudden, unex !!! Note "Backtesting" Protections are supported by backtesting and hyperopt, but must be explicitly enabled by using the `--enable-protections` flag. -!!! Warning "Setting protections from the configuration" - Setting protections from the configuration via `"protections": [],` key should be considered deprecated and will be removed in a future version. - It is also no longer guaranteed that your protections apply to the strategy in cases where the strategy defines [protections as property](hyperopt.md#optimizing-protections). - ### Available Protections * [`StoplossGuard`](#stoploss-guard) Stop trading if a certain amount of stoploss occurred within a certain time window. diff --git a/freqtrade/configuration/deprecated_settings.py b/freqtrade/configuration/deprecated_settings.py index 6a0901ed7..c4d78e588 100644 --- a/freqtrade/configuration/deprecated_settings.py +++ b/freqtrade/configuration/deprecated_settings.py @@ -177,4 +177,6 @@ def process_temporary_deprecated_settings(config: Config) -> None: ) if "protections" in config: - logger.warning("DEPRECATED: Setting 'protections' in the configuration is deprecated.") + raise ConfigurationError( + "DEPRECATED: Setting 'protections' in the configuration is deprecated." + ) diff --git a/tests/test_configuration.py b/tests/test_configuration.py index d77fae6a8..9c76272db 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -1533,8 +1533,8 @@ def test_process_deprecated_protections(default_conf, caplog): assert not log_has(message, caplog) config["protections"] = [] - process_temporary_deprecated_settings(config) - assert log_has(message, caplog) + with pytest.raises(ConfigurationError, match=message): + process_temporary_deprecated_settings(config) def test_flat_vars_to_nested_dict(caplog):