From bbb2c7cf62294a2a35e7f04d852250c9d5c468c2 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Fri, 20 Oct 2017 10:39:04 +0300 Subject: [PATCH] more parametrizing. adjust ranges for previous parameters --- freqtrade/tests/test_hyperopt.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/freqtrade/tests/test_hyperopt.py b/freqtrade/tests/test_hyperopt.py index 69da3b6b6..011fd48e5 100644 --- a/freqtrade/tests/test_hyperopt.py +++ b/freqtrade/tests/test_hyperopt.py @@ -82,7 +82,8 @@ def buy_strategy_generator(params): print(params) def populate_buy_trend(dataframe: DataFrame) -> DataFrame: conditions = [] - conditions.append(dataframe['close'] < dataframe['sma']) + if params['below_sma']['enabled']: + conditions.append(dataframe['close'] < dataframe['sma']) conditions.append(dataframe['tema'] <= dataframe['blower']) if params['mfi']['enabled']: conditions.append(dataframe['mfi'] < params['mfi']['value']) @@ -108,15 +109,19 @@ def test_hyperopt(conf, pairs, mocker): space = { 'mfi': hp.choice('mfi', [ {'enabled': False}, - {'enabled': True, 'value': hp.uniform('mfi-value', 10, 50)} + {'enabled': True, 'value': hp.uniform('mfi-value', 2, 40)} ]), 'fastd': hp.choice('fastd', [ {'enabled': False}, - {'enabled': True, 'value': hp.uniform('fastd-value', 10, 50)} + {'enabled': True, 'value': hp.uniform('fastd-value', 2, 40)} ]), 'adx': hp.choice('adx', [ {'enabled': False}, - {'enabled': True, 'value': hp.uniform('adx-value', 10, 50)} + {'enabled': True, 'value': hp.uniform('adx-value', 2, 40)} + ]), + 'below_sma': hp.choice('below_sma', [ + {'enabled': False}, + {'enabled': True} ]), }