How the two averages are calculated, where the lag comes from, and how traders keep crossovers from chopping them up.
Why everyone watches them
Moving averages are on more charts than any other study, for a simple reason: they turn a jagged line into a smooth one, so direction is easy to see. Because so many traders watch the same common ones (the 20, 50 and 200), price sometimes reacts there. That reaction comes from the crowd, not from any magic in the number.
Simple moving average (SMA)
Add up the last N closes and divide by N:
SMA(10) = (close + the 9 closes before it) / 10
Every bar in the window counts equally. When a new bar arrives, the oldest one drops out, so a big bar from 10 bars ago can still jerk the line when it leaves. The SMA is calm, but slow to admit that the trend has changed.
Exponential moving average (EMA)
The EMA moves part of the way toward each new close:
EMA = previous EMA + k × (close − previous EMA), k = 2 / (N + 1)
For a 9 EMA, k is 0.2, so each new close pulls the line 20% of the way toward it. Older bars never fully drop out; they just matter less and less. The result turns faster than an SMA of the same length, and reacts more to noise.
Same price, same length (10). After the turn, the EMA (gold) bends first; the SMA (blue) catches up a few bars later.
Picking a length
Length
Behaves like
Often used for
4 to 10
Hugs price, turns quickly, many false turns
Entry timing and fast crossovers
20 to 50
The swing of the session
Trend direction, pullback areas
200
The big picture
Which side of the market to favor
A shorter average isn't "better"; it's a different trade-off between speed and false signals. Changing a length to fit last week's chart perfectly is the fastest way to fit next week's badly.
Crossovers, and why they whipsaw
A crossover is a fast average crossing a slow one, such as a 4 EMA over a 9 EMA. In a trend it gets you in early and keeps you there. In a sideways market both lines flatten and tangle, and the cross flips back and forth, each flip a small loss.
Traders handle this in a few ways:
Trend filter: only take the cross in the direction of a slower average, or of the same averages on a higher timeframe.
Several timeframes must agree: for example the 2 and 5 minute and two range charts all pointing the same way.
Trading hours: skip the hours when your market usually chops, often midday.
Wait for the close: a cross that appears mid-bar can disappear before the bar ends.
Moving averages as support and resistance
In a steady trend, pullbacks often stall near a 20 or 21 EMA. Treat that as an area, not a line: price can poke through it by a few ticks and still hold. In a range, the same average sits in the middle of the chop and means very little.
Try it in NinjaTrader
Right-click the chart > Indicators, add EMA with period 9 and SMA with period 9.
Give them different colors and press OK.
Find a sharp turn and count the bars between the two lines turning.
Now find a quiet hour and count how many times a 4 EMA crosses a 9 EMA in it.
Educational content only, not trading advice. Indicators describe what price has already done; none of them predicts what it will do next. Practice in Sim or Playback before trading live.