Let’s say you’re currently trading your strategy, it’s yielding good profits and you want to see if you can squish some more profits (boost your strategy) out of it without over fitting. This little trick did the job for us.
Most of our strategies use time frames higher than 1 hour, so we decided to include a buy signal that will buy on re-test of important or famous emas.
As you see here, we have a candle close just right above ema200 after having a candle low below the ema200. This will serve for the boost strategy structure.
Logic To Boost Strategy
The logic would be as follow:
if candle before closes above ema200 AND current candle has a low below ema200 AND current candle closes above ema200 THEN buy
We’ll need to create the ema inside the dataframe, with just 1 line on def populate_indicators function:
Then we can simply add the following block on our def populate_buy_trend function:
dataframe.loc[ ( ( buy condition 1 #here goes your first buy condition ) | # OR symbol to add another buy condition ( (dataframe['close'].shift(1)>dataframe['ema200']) & (dataframe['low']<dataframe['ema200']) & (dataframe['close']>dataframe['ema200']) ) )
Let us know in the comments what’s your favorite exponential moving average.