add short ema guard to hyperopt
This commit is contained in:
parent
2963a90008
commit
13537e3ce4
@ -26,6 +26,8 @@ def buy_strategy_generator(params):
|
|||||||
# GUARDS AND TRENDS
|
# GUARDS AND TRENDS
|
||||||
if params['uptrend_long_ema']['enabled']:
|
if params['uptrend_long_ema']['enabled']:
|
||||||
conditions.append(dataframe['ema50'] > dataframe['ema100'])
|
conditions.append(dataframe['ema50'] > dataframe['ema100'])
|
||||||
|
if params['uptrend_short_ema']['enabled']:
|
||||||
|
conditions.append(dataframe['ema5'] > dataframe['ema10'])
|
||||||
if params['mfi']['enabled']:
|
if params['mfi']['enabled']:
|
||||||
conditions.append(dataframe['mfi'] < params['mfi']['value'])
|
conditions.append(dataframe['mfi'] < params['mfi']['value'])
|
||||||
if params['fastd']['enabled']:
|
if params['fastd']['enabled']:
|
||||||
@ -108,6 +110,10 @@ def test_hyperopt(backtest_conf, backdata, mocker):
|
|||||||
{'enabled': False},
|
{'enabled': False},
|
||||||
{'enabled': True}
|
{'enabled': True}
|
||||||
]),
|
]),
|
||||||
|
'uptrend_short_ema': hp.choice('uptrend_short_ema', [
|
||||||
|
{'enabled': False},
|
||||||
|
{'enabled': True}
|
||||||
|
]),
|
||||||
'over_sar': hp.choice('over_sar', [
|
'over_sar': hp.choice('over_sar', [
|
||||||
{'enabled': False},
|
{'enabled': False},
|
||||||
{'enabled': True}
|
{'enabled': True}
|
||||||
|
Loading…
Reference in New Issue
Block a user