From 7d6b3d0e02158685a3c13c347aa897e325a371c9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 11 Jul 2022 08:14:39 +0200 Subject: [PATCH] Update hyperopt param docs to be clear that non-conclusive parameters will be ignored --- docs/hyperopt.md | 3 ++- freqtrade/strategy/hyper.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 63c7a4413..f44a68037 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -271,7 +271,8 @@ The last one we call `trigger` and use it to decide which buy trigger we want to !!! Note "Parameter space assignment" Parameters must either be assigned to a variable named `buy_*` or `sell_*` - or contain `space='buy'` | `space='sell'` to be assigned to a space correctly. - If no parameter is available for a space, you'll receive the error that no space was found when running hyperopt. + If no parameter is available for a space, you'll receive the error that no space was found when running hyperopt. + Parameters with unclear space (e.g. `adx_period = IntParameter(4, 24, default=14)` - no explicit nor implicit space) will not be detected and will therefore be ignored. So let's write the buy strategy using these values: diff --git a/freqtrade/strategy/hyper.py b/freqtrade/strategy/hyper.py index cdcfc969e..47377f238 100644 --- a/freqtrade/strategy/hyper.py +++ b/freqtrade/strategy/hyper.py @@ -191,6 +191,7 @@ def detect_parameters( and attr.category is not None and attr.category != category): raise OperationalException( f'Inconclusive parameter name {attr_name}, category: {attr.category}.') + if (category == attr.category or (attr_name.startswith(category + '_') and attr.category is None)): yield attr_name, attr