Language: English. Choose a language
Get started

← The library

July 13, 2026

BeginnerTechnical Indicators4 min

What a moving average actually tells you

Draw a 20-bar simple, exponential and weighted average over the same turn in price and you get three lines in three different places, though each is “an average of 20”. This is the moving average explained from that puzzle outwards. By the end you will be able to compute an SMA, EMA and WMA, read slope and distance from price, and choose a type and length on purpose.

What a moving average measures in one sentence

A moving average is a weighted summary of the last N prices, drawn as a line. Each point is one summary; the next point slides the window forward one bar.

The last point on the line is nothing more than the average of the twenty closes in the bracket.

The line is a summary, not a forecast. It describes where price has been, smoothed, and says nothing about the next bar. Nor is it a level price must respect: the 200-day average is a calculation, and price crosses it as freely as any other line.

The formulas, one step at a time

The worked table below uses ten synthetic closes and a short length, N = 5, so all three averages appear within ten bars.

Bar Close SMA(5) WMA(5) EMA(5)
1 100.00 – – –
2 100.80 – – –
3 102.08 – – –
4 104.60 – – –
5 103.08 102.11 102.78 102.11
6 106.18 103.35 104.13 103.47
7 104.27 104.04 104.44 103.74
8 105.47 104.72 104.92 104.31
9 106.00 105.00 105.34 104.88
10 105.39 105.46 105.47 105.05

Simple average

Every close in the window counts equally. On bar 5, add the five closes (510.56) and divide by 5: 102.11. On bar 6, drop the oldest and add the newest, then divide again.

Exponential average

Alpha is 2 ÷ (5 + 1) = 1/3. The EMA has no value of its own until it is seeded, so bar 5 takes the SMA, 102.11. On bar 6 it becomes 1/3 × 106.18 + 2/3 × 102.11 = 103.47. Each later bar blends a third of the new close with two thirds of the previous EMA.

Weighted average

The weights run 1, 2, 3, 4, 5, oldest to newest, and sum to 15. On bar 5: (1 × 100.00 + 2 × 100.80 + 3 × 102.08 + 4 × 104.60 + 5 × 103.08) ÷ 15 = 102.78. Recent closes pull harder, so the WMA sits nearer the latest price.

Same length, three weightings: that difference alone explains why the three lines sit apart.

Reading the line: slope, distance and crossings

Slope, the change in the average per bar, describes the direction of the smoothed price. A rising slope says recent closes have been higher on balance; a flattening slope says that drift is fading.

Distance from price says how stretched price is relative to its own recent summary. Measure it in ATR units, (close − average) ÷ ATR(14), so a reading on a quiet series and a volatile one mean the same thing. A distance of two ATRs describes stretch, not value: it does not say price is too high, and in a steady trend it can stay stretched for a long time, as the synthetic series below does. Crossings of price and average are simply the moments distance changes sign.

Distance in ATRs measures stretch; in a steady trend it can sit beyond two ATRs for many bars.

Why the three types disagree

Different weights mean different lag. Because the EMA and WMA put more weight on recent bars, they react sooner. Take a clean turn: price rises one point a bar for 60 bars, then falls one point a bar. With N = 20, the WMA and the EMA turn down 7 bars after the peak; the SMA turns down 11 bars after it. That order is typical of a steady turn like this one, not a rule for every reversal: after a sudden spike, the SMA and WMA can turn down first as the spike leaves their window, while the EMA is still rising.

Faster is not better. The EMA’s quicker turn comes with more turns that reverse again. EMA is not better than SMA; it answers with less delay and more noise.

What changing the length does

Shorter averages are faster and noisier; longer ones are slower and smoother. On one synthetic 400-bar series, the slope of the 20-bar average changed direction 27 times, the 50-bar 25 times and the 200-bar 11 times.

Longer averages change direction less often, at the cost of turning later.

The common lengths 20, 50 and 200 are conventions, not discoveries. They are popular because many people use them, which makes them familiar but not special.

Setting Default Effect
Period 20 Shorter reacts faster and turns more often; longer smooths more and lags more.
Type simple Exponential and weighted versions react sooner at the same length.
Source Close HL2 or HLC3 shift values slightly; keep one source per study.
Offset 0 Shifts the plot sideways for display; never use a shifted value as current information.

Where moving averages mislead

The first trap is treating the line as support or resistance by default. Price sometimes pauses near a popular average and often does not; the line itself has no force. The second is reading crossings in a range. When price moves sideways, it crosses a flat average again and again, and each crossing describes nothing more than the noise. A third is reading “price above the average” as “price will keep rising”. It is a fact about the past window only.

Pairings that add information

Pair the average with a measure that answers a different question. ATR turns distance into comparable units; ADX describes trend strength, which slope alone cannot. A second average of nearby length, say 20 and 25, mostly repeats the first.

Pairs well with

  • ATR (average true range), for distance in comparable units.
  • ADX and DMI, for trend strength rather than direction.
  • Moving average crossovers, for what two averages of very different lengths measure together.

Try moving averages on any chart

On any chart, add a moving average and switch it between simple and exponential, and between 20 and 50 bars. Then try the indicator lag tool to watch lag change with length.

Sources


Analess is an analysis tool, not investment advice. Nothing here is a recommendation to buy, sell, or hold anything.