From e3a6c71087c1fe1f8e4dd47669221c6e4bba8de3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 29 Sep 2024 09:41:02 +0200 Subject: [PATCH] chore: Remove protections from config logic --- freqtrade/optimize/backtesting.py | 4 ---- freqtrade/resolvers/strategy_resolver.py | 1 - freqtrade/rpc/api_server/api_backtest.py | 1 - 3 files changed, 6 deletions(-) diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 20116f670..75c0ac075 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -273,10 +273,6 @@ class Backtesting: def _load_protections(self, strategy: IStrategy): if self.config.get("enable_protections", False): - conf = self.config - if hasattr(strategy, "protections"): - conf = deepcopy(conf) - conf["protections"] = strategy.protections self.protections = ProtectionManager(self.config, strategy.protections) def load_bt_data(self) -> Tuple[Dict[str, DataFrame], TimeRange]: diff --git a/freqtrade/resolvers/strategy_resolver.py b/freqtrade/resolvers/strategy_resolver.py index d234a680f..6cd0cef23 100644 --- a/freqtrade/resolvers/strategy_resolver.py +++ b/freqtrade/resolvers/strategy_resolver.py @@ -69,7 +69,6 @@ class StrategyResolver(IResolver): ("order_time_in_force", None), ("stake_currency", None), ("stake_amount", None), - ("protections", None), ("startup_candle_count", None), ("unfilledtimeout", None), ("use_exit_signal", True), diff --git a/freqtrade/rpc/api_server/api_backtest.py b/freqtrade/rpc/api_server/api_backtest.py index e4b598807..4f6484538 100644 --- a/freqtrade/rpc/api_server/api_backtest.py +++ b/freqtrade/rpc/api_server/api_backtest.py @@ -77,7 +77,6 @@ def __run_backtest_bg(btconfig: Config): lastconfig["timerange"] = btconfig["timerange"] lastconfig["timeframe"] = strat.timeframe - lastconfig["protections"] = btconfig.get("protections", []) lastconfig["enable_protections"] = btconfig.get("enable_protections") lastconfig["dry_run_wallet"] = btconfig.get("dry_run_wallet")