From 660f01b51432b4d844cd45cdcdabfd16abc741c9 Mon Sep 17 00:00:00 2001 From: Janne Sinivirta Date: Sun, 12 Nov 2017 09:13:54 +0200 Subject: [PATCH] add hilbert transform leadsine trigger --- freqtrade/analyze.py | 3 +++ freqtrade/tests/test_hyperopt.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/freqtrade/analyze.py b/freqtrade/analyze.py index e9ef9c290..3143abc1f 100644 --- a/freqtrade/analyze.py +++ b/freqtrade/analyze.py @@ -49,6 +49,9 @@ def populate_indicators(dataframe: DataFrame) -> DataFrame: dataframe['macd'] = macd['macd'] dataframe['macdsignal'] = macd['macdsignal'] dataframe['macdhist'] = macd['macdhist'] + hilbert = ta.HT_SINE(dataframe) + dataframe['htsine'] = hilbert['sine'] + dataframe['htleadsine'] = hilbert['leadsine'] return dataframe diff --git a/freqtrade/tests/test_hyperopt.py b/freqtrade/tests/test_hyperopt.py index d8d1a712a..9e33829b9 100644 --- a/freqtrade/tests/test_hyperopt.py +++ b/freqtrade/tests/test_hyperopt.py @@ -53,6 +53,7 @@ def buy_strategy_generator(params): 'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])), 'sar_reversal': (crossed_above(dataframe['close'], dataframe['sar'])), 'stochf_cross': (crossed_above(dataframe['fastk'], dataframe['fastd'])), + 'ht_sine': (crossed_above(dataframe['htleadsine'], dataframe['htsine'])), } conditions.append(triggers.get(params['trigger']['type'])) @@ -134,6 +135,7 @@ def test_hyperopt(backtest_conf, backdata, mocker): {'type': 'macd_cross_signal'}, {'type': 'sar_reversal'}, {'type': 'stochf_cross'}, + {'type': 'ht_sine'}, ]), } trials = Trials()