feat: add builtin spaces enter and exit

This commit is contained in:
Matthias
2025-11-06 20:30:04 +01:00
parent a3efba019f
commit 649aff8076
5 changed files with 20 additions and 6 deletions

View File

@@ -44,6 +44,8 @@ HYPEROPT_LOSS_BUILTIN = [
HYPEROPT_BUILTIN_SPACES = [
"buy",
"sell",
"enter",
"exit",
"roi",
"stoploss",
"trailing",

View File

@@ -67,7 +67,9 @@ class HyperOptAuto(IHyperOpt):
if attr.optimize:
yield attr.get_space(attr_name)
def get_indicator_space(self, category: Literal["buy", "sell", "protection"] | str) -> list:
def get_indicator_space(
self, category: Literal["buy", "sell", "enter", "exit", "protection"] | str
) -> list:
"""
Get indicator space for a given space.
:param category: parameter space to get.

View File

@@ -166,7 +166,7 @@ def detect_all_parameters(
:param obj: Strategy object or class
:return: Dictionary of detected parameters by space
"""
auto_categories = ["buy", "sell", "protection"]
auto_categories = ["buy", "sell", "enter", "exit", "protection"]
result: AllSpaceParams = defaultdict(dict)
for attr_name in dir(obj):
if attr_name.startswith("__"): # Ignore internals