add short ema guard to hyperopt

This commit is contained in:
Janne Sinivirta 2017-11-12 08:45:32 +02:00
parent 2963a90008
commit 13537e3ce4

View File

@ -26,6 +26,8 @@ def buy_strategy_generator(params):
# GUARDS AND TRENDS
if params['uptrend_long_ema']['enabled']:
conditions.append(dataframe['ema50'] > dataframe['ema100'])
if params['uptrend_short_ema']['enabled']:
conditions.append(dataframe['ema5'] > dataframe['ema10'])
if params['mfi']['enabled']:
conditions.append(dataframe['mfi'] < params['mfi']['value'])
if params['fastd']['enabled']:
@ -108,6 +110,10 @@ def test_hyperopt(backtest_conf, backdata, mocker):
{'enabled': False},
{'enabled': True}
]),
'uptrend_short_ema': hp.choice('uptrend_short_ema', [
{'enabled': False},
{'enabled': True}
]),
'over_sar': hp.choice('over_sar', [
{'enabled': False},
{'enabled': True}