Advertisement IC Markets

How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Optimize MetaTrader 4, MetaTrader 5, cTrader, and TradingView for speed. Discuss Level II Market Depth (DOM), custom hotkeys, and volume indicators.
Post Reply
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Post by Fairman »

How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

An exponential moving average with period n uses the smoothing factor 2 / (n + 1). In a steady ramp, where price rises by the same amount each bar, the EMA settles into a constant lag behind price of (n minus 1) / 2 bars. That's the same lag as a simple average of the same period.

For a drift of 1.2 pips a bar, which is a decent M5 trend, the gaps are:

EMA 9: lags 4 bars, 4.8 pips behind price.
EMA 21: lags 10 bars, 12 pips.
EMA 50: lags 24.5 bars, 29.4 pips.

I checked this with a loop that fed a ramp into the formula for 1,000 bars, and the lag settled at 4.0, 10.0 and 24.5 bars.

Where this helps is in setting the distance between price and the EMA that means something. If price is 5 pips above EMA 9 in a ramp of 1.2 pips a bar, that's not stretched: it's what a steady trend looks like. A pullback entry that waits for price to touch the EMA 21 in the same trend needs price to fall back 12 pips, which is 10 bars of drift, so the pullback has to erase ten bars of progress.

So the distance to an EMA is a measure of trend speed. Divide the pip gap by the lag in bars and you recover the drift per bar. A gap of 12 pips to the EMA 21 means about 1.2 pips a bar.
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Post by Fairman »

Real price isn't a ramp, so treat these gaps as the textbook case. In a choppy stretch the average of past prices is closer to the current price than the ramp formula says, so a gap divided by the lag gives a conservative drift estimate. The quickest check is to take the 12 pip gap to the 21 EMA and compare it with the net rise over the last 10 bars. When the two numbers are close, the move was smooth, and when they're far apart it was jerky. The difference tells you something the indicator alone doesn't.
It’s Fairman :geek:
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Post by Fairman »

The lag shows why short EMAs give early and noisy signals. The 9 EMA lags 4 bars, so touches and crosses come soon after a turn, but a small counter move is enough to flip it. The 50 EMA lags 24.5 bars, so a cross of price through it needs a lot of price movement to build. In the 1.2 pip a bar example, price has to give back 29.4 pips from the high before it reaches the 50 EMA, and that's more than three typical scalping targets. Each period you choose is a decision about how much of the move you're willing to give back before a signal.
It’s Fairman :geek:
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Post by Fairman »

A pullback rule tied to the EMA 21 has a built in assumption. In a ramp of 1.2 pips a bar, the line is 12 pips behind price, so "buy when price touches the EMA 21" asks for a 12 pip pullback. With a stop 6 pips beyond the line the risk is 18 pips from the high, and from the touch, 6 pips. Say the 1R target is 9 pips: the trade only makes sense if price is likely to turn at that line, so test that on your own data before sizing it. Count how many touches of the line in uptrends held and how many broke.
It’s Fairman :geek:
Fairman
Posts: 6757
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: How far behind price is an EMA in a steady move: 9, 21 and 50 on a 1.2 pip per bar drift

Post by Fairman »

You can test the formula without any platform. In a spreadsheet, put a ramp in column A, adding 1.2 each row for 200 rows. In column B start the EMA 21 at the first price and use =B1+(2/22)*(A2-B1) in the next row, filled down. At the bottom the gap between A and B should settle at 12.0. Do the same with 2/10 for the 9 period and 2/51 for the 50, and you should see about 4.8 and 29.4. Then you know the formula works, and the lag doesn't depend on any platform's version of the indicator.
It’s Fairman :geek:
Post Reply