1990issue C081
Constructing triangular moving average weights
A triangular moving average can be built from a nominated period by placing a conventional peak of 2.0 at the midpoint, stepping neighboring weights linearly back to zero, and dividing the weighted observations by a sum equal to one plus the number of weights.
- For every chosen period P, the largest assigned weight is conventionally 2.0 and sits at the midpoint observation.
- Neighboring weights change by a constant increment of 2 divided by P/2 and return to zero at time index P, so the effective count n equals P minus 1.
- Under this convention the weight sum S always equals n plus 1, and the smoothed value is the weighted observation sum divided by S.
- After period P is specified, the incremental weights and the triangular moving-average value can be computed directly from that schedule.
A centered weighting schedule
A triangular moving average is a centered smoother over ordered price, volume, or breadth observations that raises weights linearly to a midpoint peak and then lowers them back to zero across a chosen period.
After a period P is specified, the incremental weights and the resulting triangular moving-average value can be computed directly from that schedule.
20-period triangular moving-average weights

The source fixes the peak weight at 2.0 for every P and sets the step to 2/(P/2). It counts n=P−1 effective weights, dropping the terminal zero, and divides the weighted sum by S=n+1.
Place a conventional peak at the midpoint
A triangular moving average is constructed so that, for every chosen period P, the largest assigned weight is conventionally 2.0.
When P equals 20, that peak of 2.0 is placed at the midpoint observation at time index 10. Choosing P of 10 still uses the same conventional peak of 2.0.
Step the remaining weights back to zero
When P equals 20, neighboring weights change by 0.2, which is 2 divided by P/2. Weights return to zero at time index P, so the count of effective observations and weights n equals P minus 1. For P of 20 that count is 19.
Choosing P of 10 produces nine weights that step by 0.4 and range from 0.4 to 2.0.
Divide by a sum fixed to the weight count
Under this weighting convention the sum of the weights S always equals one plus the number of weights, or n plus 1.
The smoothed value is the sum of each observation in the window multiplied by its matching weight, then divided by that weight sum S.
All readings on this track · 8 readings
- 1989Constructing lag-matched triangular moving averages
- 1990Lag-aligned MACD from triangular moving averages
- 1990Constructing triangular moving average weights
- 1990Constructing a lag-aligned triangular MACD
- 1998Paired tests for moving-average lag and smoothness
- 1999Fixed-lag construction of moving-average smoothers
- 2003Weighting recipes inside one moving-average lookback
- 2010Assembling a smoothed percent-b oscillator from Heikin-Ashi and stacked averages