add ema50 and ema100. add long uptrend ema guard to hyperopt
This commit is contained in:
parent
893738d6f0
commit
473d09b5cd
@ -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']
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user