mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-15 04:11:14 +00:00
feat: support "--spaces all" with custom spaces
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user