1990issue C111-2
Constructing a five-day step-weighted moving average
A five-observation step-weighted moving average multiplies successive values by the integers 1 through 5 and divides by 15. The same moving-average object can be written in noniterative form or revised in one step from the newest observation and a lagged running window sum.
- A five-observation step-weighted moving average multiplies successive values by the integers 1 through 5 and divides by the sum of those weights.
- For a window of n observations the normalizing divisor is n(n+1)/2, which equals 15 when n is 5.
- Evaluating that five-weight formula on four successive windows yields 26.10, then 26.77, then 27.57, then 27.57.
- The iterative form adds (5 times the newest observation minus the previous five-observation sum) divided by 15 to the previous average, while the running window sum computed at this step is reserved for the next update.
Integer weights for five observations
A five-observation step-weighted moving average multiplies successive values by the integers 1 through 5 and divides by the sum of those weights.
A step-weighted moving average is a weighted moving average whose weights rise by one integer from the oldest observation in the window to the newest. The weighted moving average applies an explicit unequal weight to each observation in a fixed lookback and normalizes by the sum of those weights.
The triangular-number normalizing divisor
For a window of n observations the weight-sum divisor is n(n+1)/2, which equals 15 when n is 5. That quantity is the normalizing divisor: the sum of the assigned weights. For consecutive integer weights 1 through n it equals n(n+1)/2.
Noniterative evaluation of four windows
Evaluating that five-weight formula on four successive windows yields 26.10, then 26.77, then 27.57, then 27.57.
That calculation is the noniterative form: direct evaluation of the current window as a weighted sum divided by the weight total. The result is a moving average, a forecast formed from ordered price, volume, or breadth observations over a defined sampling interval and lookback.
An iterative form that lags the running sum
An iterative update obtains the next value by adding (5 times the newest observation minus the previous five-observation sum) divided by 15 to the previous average. That iterative form is an equivalent one-step update that revises the previous average from the newest observation and the previous window sum.
The companion running sum is maintained by adding the newest observation and subtracting the observation that leaves the five-day window. That running window sum is the unweighted total of observations inside the current lookback, carried forward only to compute the next update.
The average at a given step uses the running sum from the prior step, so the sum computed at the current step is reserved for the following update.
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