From f93c90661446b91ab69987a16d209e8784631f38 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 6 Nov 2025 20:36:40 +0100 Subject: [PATCH] test: improve tests for new builtin spaces --- tests/optimize/test_hyperopt.py | 6 +++++- tests/strategy/strats/hyperoptable_strategy.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/optimize/test_hyperopt.py b/tests/optimize/test_hyperopt.py index 8ea203bb4..7f986a3d6 100644 --- a/tests/optimize/test_hyperopt.py +++ b/tests/optimize/test_hyperopt.py @@ -569,6 +569,7 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None: "buy_rsi": 35, "sell_minusdi": 0.02, "sell_rsi": 75, + "exit_rsi": 7, "exitaaa": 7, "protection_cooldown_lookback": 20, "protection_enabled": True, @@ -598,9 +599,12 @@ def test_generate_optimizer(mocker, hyperopt_conf) -> None: "buy_plusdi": 0.02, "buy_rsi": 35, }, - "exit": { + "exitaspace": { "exitaaa": 7, }, + "exit": { + "exit_rsi": 7, + }, "roi": {"0": 0.12, "20.0": 0.02, "50.0": 0.01, "110.0": 0}, "protection": { "protection_cooldown_lookback": 20, diff --git a/tests/strategy/strats/hyperoptable_strategy.py b/tests/strategy/strats/hyperoptable_strategy.py index 32d1e63bf..73b072e19 100644 --- a/tests/strategy/strats/hyperoptable_strategy.py +++ b/tests/strategy/strats/hyperoptable_strategy.py @@ -35,7 +35,9 @@ class HyperoptableStrategy(StrategyTestV3): sell_minusdi = DecimalParameter( low=0, high=1, default=0.5001, decimals=3, space="sell", load=False ) - exitaaa = IntParameter(low=0, high=10, default=5, space="exit") + exitaaa = IntParameter(low=0, high=10, default=5, space="exitaspace") + + exit_rsi = IntParameter(low=0, high=10, default=5) protection_enabled = BooleanParameter(default=True) protection_cooldown_lookback = IntParameter([0, 50], default=30)