From 91866c1165b15166f41575ca597f82e5dee801b8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 5 Nov 2025 20:46:53 +0100 Subject: [PATCH] refactor: move lookup dictionary outside of loop --- freqtrade/optimize/hyperopt_tools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/optimize/hyperopt_tools.py b/freqtrade/optimize/hyperopt_tools.py index 4dcc93044..d343f6ee5 100644 --- a/freqtrade/optimize/hyperopt_tools.py +++ b/freqtrade/optimize/hyperopt_tools.py @@ -222,11 +222,11 @@ class HyperoptTools: all_spaces = list(params.keys() | non_optimized.keys()) spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "max_open_trades"] spaces += [s for s in all_spaces if s not in spaces] + lookup = { + "roi": "ROI", + "trailing": "Trailing stop", + } for space in spaces: - lookup = { - "roi": "ROI", - "trailing": "Trailing stop", - } name = lookup.get( space, space.capitalize() if space in HYPEROPT_BUILTIN_SPACES else space )