refactor: move lookup dictionary outside of loop

This commit is contained in:
Matthias
2025-11-05 20:46:53 +01:00
parent 4a8f487b68
commit 91866c1165

View File

@@ -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
)