make faststoch trigger use crossed_above helper

This commit is contained in:
Janne Sinivirta 2017-11-11 09:26:05 +02:00
parent 83fd27e031
commit 274972f7af

View File

@ -42,11 +42,10 @@ def buy_strategy_generator(params):
prevsma = dataframe['sma'].shift(1) prevsma = dataframe['sma'].shift(1)
conditions.append(dataframe['sma'] > prevsma) conditions.append(dataframe['sma'] > prevsma)
prev_fastd = dataframe['fastd'].shift(1)
# TRIGGERS # TRIGGERS
triggers = { triggers = {
'lower_bb': dataframe['tema'] <= dataframe['blower'], 'lower_bb': dataframe['tema'] <= dataframe['blower'],
'faststoch10': (dataframe['fastd'] >= 10) & (prev_fastd < 10), 'faststoch10': (crossed_above(dataframe['fastd'], 10.0)),
'ao_cross_zero': (crossed_above(dataframe['ao'], 0.0)), 'ao_cross_zero': (crossed_above(dataframe['ao'], 0.0)),
'ema5_cross_ema10': (crossed_above(dataframe['ema5'], dataframe['ema10'])), 'ema5_cross_ema10': (crossed_above(dataframe['ema5'], dataframe['ema10'])),
'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])), 'macd_cross_signal': (crossed_above(dataframe['macd'], dataframe['macdsignal'])),