add RSI to hyperopt

This commit is contained in:
Janne Sinivirta 2017-10-28 16:21:07 +03:00
parent 57a17697a0
commit ec981b415a

View File

@ -52,6 +52,8 @@ def buy_strategy_generator(params):
conditions.append(dataframe['adx'] > params['adx']['value']) conditions.append(dataframe['adx'] > params['adx']['value'])
if params['cci']['enabled']: if params['cci']['enabled']:
conditions.append(dataframe['cci'] < params['cci']['value']) conditions.append(dataframe['cci'] < params['cci']['value'])
if params['rsi']['enabled']:
conditions.append(dataframe['rsi'] < params['rsi']['value'])
if params['over_sar']['enabled']: if params['over_sar']['enabled']:
conditions.append(dataframe['close'] > dataframe['sar']) conditions.append(dataframe['close'] > dataframe['sar'])
if params['uptrend_sma']['enabled']: if params['uptrend_sma']['enabled']:
@ -114,6 +116,10 @@ def test_hyperopt(conf, pairs, mocker):
{'enabled': False}, {'enabled': False},
{'enabled': True, 'value': hp.uniform('cci-value', -200, -100)} {'enabled': True, 'value': hp.uniform('cci-value', -200, -100)}
]), ]),
'rsi': hp.choice('rsi', [
{'enabled': False},
{'enabled': True, 'value': hp.uniform('rsi-value', 20, 30)}
]),
'below_sma': hp.choice('below_sma', [ 'below_sma': hp.choice('below_sma', [
{'enabled': False}, {'enabled': False},
{'enabled': True} {'enabled': True}