From c88a92b4f952c8d44be739b95cfd8848e2a25f96 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 1 Nov 2025 16:12:28 +0100 Subject: [PATCH] feat: allow init of random spaces --- freqtrade/optimize/hyperopt/hyperopt_optimizer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/freqtrade/optimize/hyperopt/hyperopt_optimizer.py b/freqtrade/optimize/hyperopt/hyperopt_optimizer.py index 4eda78004..213dbd074 100644 --- a/freqtrade/optimize/hyperopt/hyperopt_optimizer.py +++ b/freqtrade/optimize/hyperopt/hyperopt_optimizer.py @@ -222,7 +222,12 @@ class HyperOptimizer: """ Assign the dimensions in the hyperoptimization space. """ - for space in ["buy", "sell", "protection", "roi", "stoploss", "trailing", "trades"]: + spaces = ["buy", "sell", "protection", "roi", "stoploss", "trailing", "trades"] + spaces += [ + s for s in self.config["spaces"] if s not in spaces and s not in ("all", "default") + ] + + for space in spaces: if not HyperoptTools.has_space(self.config, space): continue logger.debug(f"Hyperopt has '{space}' space")