add heikenashi reversal bullish trigger to hyperopt

This commit is contained in:
Janne Sinivirta 2018-01-16 13:53:30 +02:00
parent ce963aae58
commit 8896b39231
2 changed files with 3 additions and 2 deletions

View File

@ -211,14 +211,12 @@ def populate_indicators(dataframe: DataFrame) -> DataFrame:
# Chart type
# ------------------------------------
"""
# Heikinashi stategy
heikinashi = qtpylib.heikinashi(dataframe)
dataframe['ha_open'] = heikinashi['open']
dataframe['ha_close'] = heikinashi['close']
dataframe['ha_high'] = heikinashi['high']
dataframe['ha_low'] = heikinashi['low']
"""
return dataframe

View File

@ -107,6 +107,7 @@ SPACE = {
{'type': 'macd_cross_signal'},
{'type': 'sar_reversal'},
{'type': 'ht_sine'},
{'type': 'heiken_reversal_bull'},
]),
'stoploss': hp.uniform('stoploss', -0.5, -0.02),
}
@ -241,6 +242,8 @@ def buy_strategy_generator(params):
'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])),
'sar_reversal': (crossed_above(dataframe['close'], dataframe['sar'])),
'ht_sine': (crossed_above(dataframe['htleadsine'], dataframe['htsine'])),
'heiken_reversal_bull': (crossed_above(dataframe['ha_close'], dataframe['ha_open'])) &
(dataframe['ha_low'] == dataframe['ha_open']),
}
conditions.append(triggers.get(params['trigger']['type']))