From 4d5f6ed5e2ded66acf186e38d0bf9c6bf064b2e5 Mon Sep 17 00:00:00 2001 From: Stefano Ariestasia Date: Wed, 30 Mar 2022 08:37:11 +0900 Subject: [PATCH] Update strategy-customization.md --- docs/strategy-customization.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index e3fccbd38..9abe53ddf 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -236,24 +236,24 @@ def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFram Please make sure to set [`can_short`]() appropriately on your strategy if you intend to short. ```python - def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - dataframe.loc[ - ( - (qtpylib.crossed_above(dataframe['rsi'], 30)) & # Signal: RSI crosses above 30 - (dataframe['tema'] <= dataframe['bb_middleband']) & # Guard - (dataframe['tema'] > dataframe['tema'].shift(1)) & # Guard - (dataframe['volume'] > 0) # Make sure Volume is not 0 - ), - ['enter_long', 'enter_tag']] = (1, 'rsi_cross') + def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: + dataframe.loc[ + ( + (qtpylib.crossed_above(dataframe['rsi'], 30)) & # Signal: RSI crosses above 30 + (dataframe['tema'] <= dataframe['bb_middleband']) & # Guard + (dataframe['tema'] > dataframe['tema'].shift(1)) & # Guard + (dataframe['volume'] > 0) # Make sure Volume is not 0 + ), + ['enter_long', 'enter_tag']] = (1, 'rsi_cross') - dataframe.loc[ - ( - (qtpylib.crossed_below(dataframe['rsi'], 70)) & # Signal: RSI crosses below 70 - (dataframe['tema'] > dataframe['bb_middleband']) & # Guard - (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard - (dataframe['volume'] > 0) # Make sure Volume is not 0 - ), - ['enter_short', 'enter_tag']] = (1, 'rsi_cross') + dataframe.loc[ + ( + (qtpylib.crossed_below(dataframe['rsi'], 70)) & # Signal: RSI crosses below 70 + (dataframe['tema'] > dataframe['bb_middleband']) & # Guard + (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard + (dataframe['volume'] > 0) # Make sure Volume is not 0 + ), + ['enter_short', 'enter_tag']] = (1, 'rsi_cross') return dataframe ```