The core idea of this strategy is to buy when there is an upward breakout of the short-term moving average during the session, in order to capture opportunities for short-term trend reversals.
Specifically, the strategy calculates the crossover between the low price and the SMA of length smoothness as the buy signal. When the low price breaks down from above across the SMA line, a buy signal is generated. Then it exits unconditionally after 20 bars.
The strategy attempts to capture short-term reversal opportunities. When the price falls to a certain level, the short-term SMA provides support, and the bullish forces could take over again, pushing the price to bounce back. Buying at this time could gain profits from the pullback.
Risks can be reduced by optimizing stop loss strategy, adding trend filter, allowing loose holding position etc.
This is a simple short-term mean reversal strategy, using MA breakout as entry timing. The advantages are being simple and widely applicable; the disadvantages are vulnerablility to stop loss and failed reversal risks. Risks can be managed through strict stop loss control, and the strategy can be improved by optimizing rules around trend filters, re-entry etc. It is suitable for beginners to learn and optimize such basic strategy ideas.
//@version=3 strategy(title="Buy The Dip", shorttitle="BTFD", overlay=true) dipness = input(title="Dipness",defval=2) smoothness = input(title="Smoothing",defval=10,minval=0) lookforward = input(title="Exit After This Many Bars", defval=20) thedip = low - (atr(20) * dipness) thedipsma = sma(thedip,smoothness) buyCondition = crossunder(low,thedipsma) if (buyCondition) strategy.entry("long", strategy.long) strategy.close("long",when=buyCondition[20]) plot(thedipsma)