Moving Average
- Category
- Technical Analysis
- Level
- Professional
Simple definition
The average of the last few closing prices, recalculated each period, so you can see the direction of a series without every small wiggle.
Professional definition
A filter over the price series. A simple moving average weights the last n closes equally; an exponential moving average weights the newest close most and decays older weights geometrically, with smoothing factor alpha equal to 2 divided by n plus 1. Both trade responsiveness against smoothness.
Technical definition
A causal low-pass filter. Under a linear trend an n-period SMA sits behind price by about (n-1)/2 periods, which is its centre of mass; the EMA with alpha = 2/(n+1) is built to share that centre of mass, so it reacts sooner to the newest bar but is not lag-free either. The lag is not an implementation defect: any average of past values must trail the present value while the series trends, and every crossover, slope and envelope built on an average inherits that delay.
Academic definition
A causal linear filter of a price series defined by a weighting kernel over past observations, whose output necessarily trails the series under trend.
Mechanism
Averaging suppresses variation that is not shared across the window and keeps variation that is. A trending series is one where the shared part dominates, so the average follows at a distance set by the kernel's centre of mass. Lengthening the window removes more noise and adds exactly that much more delay. The two cannot be separated, because they are the same operation.
In practice
- Who uses it
- Trend followers, systematic developers building bias filters and baselines, and analysts who need one line to summarise the state of a series.
- Why it matters
- It turns a noisy series into something smooth enough to define a trend state, a dynamic level or a regime filter, using a single parameter.
- Limitations
- It lags by construction, whipsaws in ranging markets, and the length is almost always chosen by fitting history rather than derived from the instrument.
Common mistakes
- Reading price above the average as a forecast rather than a description.
- Tuning the length on the same data used to evaluate it.
- Comparing an SMA rule with an EMA rule as if identical.
Examples
A fund uses a long average as a bias filter: positions are taken only while price is above it. The rule misses the first part of every recovery and avoids most of every long decline — the same lag, counted twice.
Five closes of 10, 11, 12, 13 and 14 give a simple average of 12. With alpha of one third and a previous exponential value of 12, a new close of 15 lifts the exponential average to 13, while the simple one moves to 13 as well but for a different reason.
- n = 5
- closes: 10, 11, 12, 13, 14
- new close: 15
- previous EMA(5) = 12
- alpha = 2 / (5 + 1) = 0.3333
- SMA before = (10 + 11 + 12 + 13 + 14) / 5 = 12
- SMA after = (11 + 12 + 13 + 14 + 15) / 5 = 13
- EMA after = 0.3333 x 15 + 0.6667 x 12 = 13.0
They agree here by arithmetic coincidence. The SMA moved because 10 left the window; the EMA moved because 15 entered with weight one third.
Mathematical foundation
Variables
| P_t | Price at period t, conventionally the close | price units |
| n | Length of the average in periods | periods |
| \alpha | EMA smoothing factor, 2/(n+1) by convention | dimensionless, between 0 and 1 |
| SMA_n, EMA_n | Simple and exponential averages of length n | price units |
Procedure
For the simple average, sum the last n closes and divide by n, dropping the oldest as each new bar arrives. For the exponential average, seed it with the simple average of the first n closes, compute alpha as 2 divided by n plus 1, then apply the recursion once per bar. State the seeding rule, because it changes the early values.
Worked example
- n = 5
- window closes: 11, 12, 13, 14, 15
- previous EMA(5) = 12
- new close P_t = 15
- alpha = 2 / 6 = 0.3333
- SMA = (11 + 12 + 13 + 14 + 15) / 5 = 65 / 5
- EMA = 0.3333 x 15 + 0.6667 x 12
Interpretation
Both outputs are prices, on the same axis as the series. Their level says where recent prices have centred; their slope says how fast that centre is moving. Neither says anything about the next bar.
Assumptions
- The factor alpha = 2/(n+1) is a convention chosen so an EMA's centre of mass matches an n-period SMA. Other platforms allow alpha to be set directly, and the same label then means a different filter.
- Seeding matters: an EMA started from the first close instead of the first SMA differs for roughly the first few n bars.
- Input series must be split and dividend adjusted consistently, or the average is computed over two different price definitions.
- Lag under trend is unavoidable and approximately (n-1)/2 periods for an SMA; no weighting scheme removes it while keeping the smoothing.
- In a range both forms oscillate around price and produce frequent, unprofitable crossings.
- Comparing a length-20 average on one timeframe with a length-20 average on another compares two different time constants.
Related terminology
- related
- Golden Cross and Death Cross Moving Average Convergence Divergence Volume-Weighted Average Price Bollinger Bands Timeframe Trendline Relative Strength Index
Volume-Weighted Average Price
A moving average weights by time: every bar in the window counts the same, or decays by age. VWAP weights by volume and usually resets each session, so it is an execution benchmark rather than a trend filter.
Sources
New York Institute of Finance · 1999 · chapter on moving averages
Print source
FT Prentice Hall · 2005 · chapters on moving averages and smoothing
Print source
CMT Association · discussion of trend-following filters and parameter selection
https://cmtassociation.org/wp-content/uploads/2019/01/Technical-Analysis-Modern-Perspectives-CMT-Association.pdf URL verified
Editorial status
Written, not yet reviewed.
