add ema50 and ema100. add long uptrend ema guard to hyperopt

This commit is contained in:
Janne Sinivirta 2017-10-28 16:52:26 +03:00
parent 893738d6f0
commit 473d09b5cd
2 changed files with 8 additions and 0 deletions

View File

@ -47,6 +47,8 @@ def populate_indicators(dataframe: DataFrame) -> DataFrame:
dataframe['mom'] = ta.MOM(dataframe)
dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)
dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)
dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)
dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)
dataframe['ao'] = awesome_oscillator(dataframe)
macd = ta.MACD(dataframe)
dataframe['macd'] = macd['macd']

View File

@ -44,6 +44,8 @@ def buy_strategy_generator(params):
conditions.append(dataframe['close'] < dataframe['sma'])
if params['over_sma']['enabled']:
conditions.append(dataframe['close'] > dataframe['sma'])
if params['uptrend_long_ema']['enabled']:
conditions.append(dataframe['ema50'] > dataframe['ema100'])
if params['mfi']['enabled']:
conditions.append(dataframe['mfi'] < params['mfi']['value'])
if params['fastd']['enabled']:
@ -129,6 +131,10 @@ def test_hyperopt(conf, pairs, mocker):
{'enabled': False},
{'enabled': True}
]),
'uptrend_long_ema': hp.choice('uptrend_long_ema', [
{'enabled': False},
{'enabled': True}
]),
'over_sar': hp.choice('over_sar', [
{'enabled': False},
{'enabled': True}