mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 11:51:19 +00:00
feat: add builtin spaces enter and exit
This commit is contained in:
@@ -44,6 +44,8 @@ HYPEROPT_LOSS_BUILTIN = [
|
||||
HYPEROPT_BUILTIN_SPACES = [
|
||||
"buy",
|
||||
"sell",
|
||||
"enter",
|
||||
"exit",
|
||||
"roi",
|
||||
"stoploss",
|
||||
"trailing",
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user