Merge pull request #5046 from freqtrade/list_strategy_hyperopt

allow list-strategies to show if params are hyperoptable
This commit is contained in:
Matthias
2021-05-30 16:36:31 +01:00
committed by GitHub
3 changed files with 39 additions and 9 deletions

View File

@@ -667,8 +667,13 @@ def test_auto_hyperopt_interface(default_conf):
# Parameter is disabled - so value from sell_param dict will NOT be used.
assert strategy.sell_minusdi.value == 0.5
all_params = strategy.detect_all_parameters()
assert isinstance(all_params, dict)
assert len(all_params['buy']) == 2
assert len(all_params['sell']) == 2
assert all_params['count'] == 4
strategy.sell_rsi = IntParameter([0, 10], default=5, space='buy')
strategy.__class__.sell_rsi = IntParameter([0, 10], default=5, space='buy')
with pytest.raises(OperationalException, match=r"Inconclusive parameter.*"):
[x for x in strategy._detect_parameters('sell')]
[x for x in strategy.detect_parameters('sell')]