add hilbert transform leadsine trigger

This commit is contained in:
Janne Sinivirta 2017-11-12 09:13:54 +02:00
parent 13537e3ce4
commit 660f01b514
2 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,9 @@ def populate_indicators(dataframe: DataFrame) -> DataFrame:
dataframe['macd'] = macd['macd'] dataframe['macd'] = macd['macd']
dataframe['macdsignal'] = macd['macdsignal'] dataframe['macdsignal'] = macd['macdsignal']
dataframe['macdhist'] = macd['macdhist'] dataframe['macdhist'] = macd['macdhist']
hilbert = ta.HT_SINE(dataframe)
dataframe['htsine'] = hilbert['sine']
dataframe['htleadsine'] = hilbert['leadsine']
return dataframe return dataframe

View File

@ -53,6 +53,7 @@ def buy_strategy_generator(params):
'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])), 'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])),
'sar_reversal': (crossed_above(dataframe['close'], dataframe['sar'])), 'sar_reversal': (crossed_above(dataframe['close'], dataframe['sar'])),
'stochf_cross': (crossed_above(dataframe['fastk'], dataframe['fastd'])), 'stochf_cross': (crossed_above(dataframe['fastk'], dataframe['fastd'])),
'ht_sine': (crossed_above(dataframe['htleadsine'], dataframe['htsine'])),
} }
conditions.append(triggers.get(params['trigger']['type'])) conditions.append(triggers.get(params['trigger']['type']))
@ -134,6 +135,7 @@ def test_hyperopt(backtest_conf, backdata, mocker):
{'type': 'macd_cross_signal'}, {'type': 'macd_cross_signal'},
{'type': 'sar_reversal'}, {'type': 'sar_reversal'},
{'type': 'stochf_cross'}, {'type': 'stochf_cross'},
{'type': 'ht_sine'},
]), ]),
} }
trials = Trials() trials = Trials()