diff --git a/freqtrade/optimize/hyperopt/hyperopt_auto.py b/freqtrade/optimize/hyperopt/hyperopt_auto.py index fd2a75c55..4ee8740a5 100644 --- a/freqtrade/optimize/hyperopt/hyperopt_auto.py +++ b/freqtrade/optimize/hyperopt/hyperopt_auto.py @@ -62,11 +62,6 @@ class HyperOptAuto(IHyperOpt): else: return default_func - def _generate_indicator_space(self, category): - for attr_name, attr in self.strategy.enumerate_parameters(category): - if attr.optimize: - yield attr.get_space(attr_name) - def get_indicator_space( self, category: Literal["buy", "sell", "enter", "exit", "protection"] | str ) -> list: @@ -74,8 +69,11 @@ class HyperOptAuto(IHyperOpt): Get indicator space for a given space. :param category: parameter space to get. """ - # TODO: is this necessary, or can we call "generate_space" directly? - indicator_space = list(self._generate_indicator_space(category)) + indicator_space = [ + attr.get_space(attr_name) + for attr_name, attr in self.strategy.enumerate_parameters(category) + if attr.optimize + ] if len(indicator_space) > 0: return indicator_space else: