mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 04:11:14 +00:00
refactor: simplify hyperopt-auto
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user