From 3d11df68e32e9415146f6920746dc4722a527116 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 3 May 2021 08:33:06 +0200 Subject: [PATCH] Be explicit with space assignment in documentation --- docs/hyperopt.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/hyperopt.md b/docs/hyperopt.md index 5f1f9bffa..d8f4a8071 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -249,11 +249,11 @@ We continue to define hyperoptable parameters: ```python class MyAwesomeStrategy(IStrategy): - buy_adx = IntParameter(20, 40, default=30) - buy_rsi = IntParameter(20, 40, default=30) - buy_adx_enabled = CategoricalParameter([True, False]) - buy_rsi_enabled = CategoricalParameter([True, False]) - buy_trigger = CategoricalParameter(['bb_lower', 'macd_cross_signal']) + buy_adx = IntParameter(20, 40, default=30, space="buy") + buy_rsi = IntParameter(20, 40, default=30, space="buy") + buy_adx_enabled = CategoricalParameter([True, False], space="buy") + buy_rsi_enabled = CategoricalParameter([True, False], space="buy") + buy_trigger = CategoricalParameter(['bb_lower', 'macd_cross_signal'], space="buy") ``` Above definition says: I have five parameters I want to randomly combine to find the best combination. @@ -262,6 +262,10 @@ Then we have three category variables. First two are either `True` or `False`. We use these to either enable or disable the ADX and RSI guards. The last one we call `trigger` and use it to decide which buy trigger we want to use. +!!! 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. + So let's write the buy strategy using these values: ```python