Add check if trigger is in parameters

This commit is contained in:
Matthias 2019-01-06 10:30:58 +01:00
parent 5e08769366
commit 798ae460d8
3 changed files with 29 additions and 26 deletions

View File

@ -98,6 +98,7 @@ So let's write the buy strategy using these values:
conditions.append(dataframe['rsi'] < params['rsi-value'])
# TRIGGERS
if 'trigger' in params:
if params['trigger'] == 'bb_lower':
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
if params['trigger'] == 'macd_cross_signal':

View File

@ -57,6 +57,7 @@ class DefaultHyperOpts(IHyperOpt):
conditions.append(dataframe['rsi'] < params['rsi-value'])
# TRIGGERS
if 'trigger' in params:
if params['trigger'] == 'bb_lower':
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
if params['trigger'] == 'macd_cross_signal':

View File

@ -66,6 +66,7 @@ class SampleHyperOpts(IHyperOpt):
conditions.append(dataframe['rsi'] < params['rsi-value'])
# TRIGGERS
if 'trigger' in params:
if params['trigger'] == 'bb_lower':
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
if params['trigger'] == 'macd_cross_signal':