diff --git a/freqtrade/optimize/hyperopt/hyperopt_auto.py b/freqtrade/optimize/hyperopt/hyperopt_auto.py index 30b649ccd..603d0b139 100644 --- a/freqtrade/optimize/hyperopt/hyperopt_auto.py +++ b/freqtrade/optimize/hyperopt/hyperopt_auto.py @@ -42,6 +42,13 @@ class HyperOptAuto(IHyperOpt): sell_indicator_space methods, but other hyperopt methods can be overridden as well. """ + def get_available_spaces(self) -> list[str]: + """ + Get list of available spaces defined in strategy. + :return: list of available spaces. + """ + return list(self.strategy._ft_hyper_params) + def _get_func(self, name) -> Callable: """ Return a function defined in Strategy.HyperOpt class, or one defined in super() class. diff --git a/freqtrade/optimize/hyperopt/hyperopt_optimizer.py b/freqtrade/optimize/hyperopt/hyperopt_optimizer.py index 390b535d4..167559f9d 100644 --- a/freqtrade/optimize/hyperopt/hyperopt_optimizer.py +++ b/freqtrade/optimize/hyperopt/hyperopt_optimizer.py @@ -223,9 +223,7 @@ class HyperOptimizer: Assign the dimensions in the hyperoptimization space. """ 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") - ] + spaces += [s for s in self.custom_hyperopt.get_available_spaces() if s not in spaces] for space in spaces: if not HyperoptTools.has_space(self.config, space):