The 5 EMA high low strategy uses two short exponential moving averages, one of the daily highs and one of the daily lows, to form a band around price. You stay out while Nifty closes inside the band, go long only on a close above the 5 EMA of highs and go short only on a close below the 5 EMA of lows. We first posted this setup on 30 November 2009 with live Nifty levels, and this page explains the method in full.

Key takeaways
- Upper band = 5-period EMA of the high. Lower band = 5-period EMA of the low.
- Inside the band means no position. The market has not shown its hand.
- Trade only on an end-of-day (EOD) close outside the band, not on an intraday spike.
- In the November 2009 example, Nifty longs were above 5071 and confirmed shorts were below 4946.
- It is a simple trend filter, so it gives whipsaws in sideways markets. Combine it with a stop and position sizing.
What is the 5 EMA high low band?
An exponential moving average gives more weight to recent prices than a simple average. TradingView gives the formula as EMA = closing price x multiplier + previous EMA x (1 – multiplier), with a smoothing factor that most traders set at 2 (TradingView). With that smoothing, the multiplier for a 5-period EMA is 2 / (5 + 1), or about 0.33, so the latest bar carries a third of the weight.
The band applies this to the highs and the lows instead of the close:
- 5 EMA (High): tracks the recent highs and acts as the upper boundary.
- 5 EMA (Low): tracks the recent lows and acts as the lower boundary.
- 5 EMA (Close): optional middle line, which we used in 2009 as an early warning level.
Because only five bars are used, the band hugs price closely. A daily close outside it is a sign that buyers or sellers have taken control for now.
5 EMA high low strategy rules
Ideal stance: no position inside the band
Our original rule was “No positions until Nifty either breaks and closes above or below either of the 5 EMA (High-Low) band.” Inside the band, price is undecided, and most false moves happen there.
Entry and exit rules
- Long entry: Nifty closes above the 5 EMA (High) on EOD basis.
- Early short warning: Nifty closes below the 5 EMA (Close).
- Confirmed short: Nifty closes below the 5 EMA (Low) on EOD basis.
- Exit long: close back below the 5 EMA (Low). Exit short: close back above the 5 EMA (High).
Using the opposite band as the exit keeps you in a trend while it lasts. A tighter trader can exit on a close back inside the band instead. We added more rules in some rules to trade using the 5 EMA low and high.
Worked example: Nifty levels from November 2009
These were the levels on the date of the original post, when Nifty was trading close to 5,000. They are history, not current levels.
| Line | Nifty level (30 Nov 2009) | Action on EOD close |
|---|---|---|
| 5 EMA (High) | 5071 | Enter longs above |
| 5 EMA (Close) | 5022 | Shorts possible below |
| 5 EMA (Low) | 4946 | Confirmed shorts below |
With Nifty between 4946 and 5071, the strategy said stay flat. Only a close outside that 125-point band would trigger a trade.
5 EMA high low strategy in AmiBroker
Here is a minimal AFL to plot the band and mark entries. EMA(), Cross() and PlotShapes() are standard AmiBroker functions.
// 5 EMA High-Low band
emaH = EMA( H, 5 ); // 5 EMA of highs (upper band)
emaL = EMA( L, 5 ); // 5 EMA of lows (lower band)
Plot( C, "Price", colorDefault, styleCandle );
Plot( emaH, "5 EMA High", colorGreen, styleLine );
Plot( emaL, "5 EMA Low", colorRed, styleLine );
Buy = Cross( C, emaH ); // close moves above the upper band
Sell = Cross( emaL, C ); // close moves below the lower band
Short = Sell;
Cover = Buy;
PlotShapes( Buy * shapeUpArrow, colorGreen, 0, L, -12 );
PlotShapes( Short * shapeDownArrow, colorRed, 0, H, -12 );
emaHandemaLcalculate the upper and lower band.- The three
Plot()lines draw candles and both bands. Buyfires when the close crosses above the upper band,Sellwhen it crosses below the lower band.ShortandCovermirror them, so the system is always in or reversing.PlotShapes()marks the signals with arrows below or above the bars.
Paste it into a new formula in AmiBroker, apply it to a daily Nifty chart, and run a backtest from the Analysis window. For our earlier versions, see the simple AFL code for the 5 EMA (High-Low) band.
For traders: making the band work
- Use it on daily or weekly charts. On 1-minute charts the band is too tight and noise dominates.
- Add a trend filter, such as trading longs only above a 13 EMA. We combined the two in the Nifty 5 EMA (High-Low) and 13 EMA strategy.
- Place a stop beyond the opposite band and size positions so one loss is a small part of capital.
- Expect a series of small losses in range-bound markets. The edge comes from the few strong trends.
Frequently Asked Questions
What is the 5 EMA high low strategy?
It is a band strategy where the 5-period EMA of highs and the 5-period EMA of lows form a channel. You go long on a close above the upper band, short on a close below the lower band, and stay flat inside.
Which timeframe suits the 5 EMA band?
Daily and weekly charts. The original Nifty rules were all on an end-of-day basis.
Can I use the 5 EMA band for Bank Nifty or stocks?
Yes, the rules work on any liquid chart. Backtest each instrument, because volatility and whipsaw frequency differ.
Why use EMA and not SMA for the band?
An EMA reacts faster to the latest bars, so the band follows price more closely and signals come earlier.
Learn by watching: free videos every week
Market Profile, order flow, Python, AI and OpenAlgo tutorials on YouTube.


rajendran sr can we get the afl for this 5 ema high low