1992issue C061
Constructing simple, weighted, and exponential moving averages
One lookback can be turned into three smoothers by changing only the recency weights. The constructions show how a simple mean, a rank-weighted mean, and a recursive update each keep a different memory of the same ordered prices.
- A simple moving average is the sum of the included prices divided by the number of observations in the window.
- A linear weighted moving average assigns the smallest integer weight to the oldest price, raises that weight by one for each newer price, and divides the weighted sum by the sum of those rank weights.
- An exponential moving average multiplies the latest price by a smoothing weight and adds the previous exponential average multiplied by one minus that weight.
- The exponential smoothing weight is approximated from the comparable simple-average length, so a five-observation case uses 0.333 on the latest price and 0.667 on the previous average.
What a lookback sets
A lookback is the count of observations used to set the average length or the matching decay weight. That count can size a simple or linear weighted window, or it can set the smoothing weight used in an exponential update.
The simple moving average
A simple moving average is the unweighted mean of a fixed number of ordered observations. It is the sum of the included prices divided by the number of observations in the window.
The linear weighted moving average
A linear weighted moving average scales each observation by a rank that rises from the oldest point to the newest, then divides by the sum of those ranks. The smallest integer weight is assigned to the oldest price and rises by one for each newer price until the newest price receives a weight equal to the window length. The average is the sum of each price times its rank weight, divided by the sum of those rank weights.
A five-observation linear weighted moving average uses weights 1 through 5 on the oldest through newest prices and divides by the sum of those five weights.
The exponential moving average
Exponential smoothing is a recursive average that mixes the latest observation with the previous smoothed value through a single decay weight. The update multiplies the latest price by a smoothing weight and adds the previous exponential average multiplied by one minus that weight. The smoothing weight is the share of the latest observation used in the recursive update, and the remainder stays with the prior smoothed value.
The exponential smoothing weight is approximated from the comparable simple-average length rather than by assigning an explicit weight to every past price. A five-observation exponential moving average uses a latest-price weight of 0.333 and a previous-average weight of 0.667.
What each formula keeps
Editorial reading: with the lookback held fixed, the three formulas still keep different past prices in view. The simple moving average gives every price in the window the same share. The linear weighted moving average gives the newest price a rank equal to the window length and the oldest price the smallest integer weight. The exponential moving average keeps one smoothing weight on the latest price and leaves the remainder with the previous smoothed value, without assigning an explicit weight to every past price.
All readings on this track · 20 readings
- 1988Indicator smoothing: lookback, weight, and scale
- 1990Recency weighting in simple, linear, and exponential moving averages
- 1990Seed and recurrence construction for moving averages
- 1990Constructing a five-day step-weighted moving average
- 1992Constructing simple, weighted, and exponential moving averages
- 1992Constructing moving averages with weighting schemes and extra filters
- 1992Constructing a weighted-average TRIN10 with Bollinger envelopes
- 1992Constructing a banded weighted open-TRIN oscillator
- 1993Evaluating a weighted dual rate-of-change momentum filter
- 1993Constructing equal, linear and exponential moving averages
- 1993Constructing a general weighted moving average from one exponent
- 1993Calibrating the weighted-moving-average exponent
- 1993Constructing an exponent-weighted average of put-call ratios
- 1994Cycle-tuned momentum with spectral peaks
- 1999How a five-bar sine-weighted average is assembled
- 2003Same-scale trend filter from a rolling least-squares endpoint
- 2003How a rolling linear-regression endpoint is assembled as a moving-trend
- 2004Constructing a volume-weighted moving average as a forecast baseline
- 2005Constructing a move, volume and recency weighted average
- 2016MACD as a zero-line filter with dual moving averages