Add check if trigger is in parameters
This commit is contained in:
parent
5e08769366
commit
798ae460d8
@ -98,6 +98,7 @@ So let's write the buy strategy using these values:
|
|||||||
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
||||||
|
|
||||||
# TRIGGERS
|
# TRIGGERS
|
||||||
|
if 'trigger' in params:
|
||||||
if params['trigger'] == 'bb_lower':
|
if params['trigger'] == 'bb_lower':
|
||||||
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
||||||
if params['trigger'] == 'macd_cross_signal':
|
if params['trigger'] == 'macd_cross_signal':
|
||||||
|
@ -57,6 +57,7 @@ class DefaultHyperOpts(IHyperOpt):
|
|||||||
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
||||||
|
|
||||||
# TRIGGERS
|
# TRIGGERS
|
||||||
|
if 'trigger' in params:
|
||||||
if params['trigger'] == 'bb_lower':
|
if params['trigger'] == 'bb_lower':
|
||||||
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
||||||
if params['trigger'] == 'macd_cross_signal':
|
if params['trigger'] == 'macd_cross_signal':
|
||||||
|
@ -66,6 +66,7 @@ class SampleHyperOpts(IHyperOpt):
|
|||||||
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
conditions.append(dataframe['rsi'] < params['rsi-value'])
|
||||||
|
|
||||||
# TRIGGERS
|
# TRIGGERS
|
||||||
|
if 'trigger' in params:
|
||||||
if params['trigger'] == 'bb_lower':
|
if params['trigger'] == 'bb_lower':
|
||||||
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
conditions.append(dataframe['close'] < dataframe['bb_lowerband'])
|
||||||
if params['trigger'] == 'macd_cross_signal':
|
if params['trigger'] == 'macd_cross_signal':
|
||||||
|
Loading…
Reference in New Issue
Block a user