Moving average length, weight, and alignment
Three choices define a moving average: window length, weighting scheme, and where the result is plotted against the source series. A fixed N is unlikely to remain suitable indefinitely for one series.
- An equally weighted moving average of N observations is their arithmetic mean, so the only free parameter is the window length.
- There is no single agreed procedure for choosing N. Each stock or commodity series is often treated as having its own characteristic length, and a length that later drifts is unlikely to stay suitable.
- Unequal weights replace the equal share of each observation and can be adjusted by comparing trial weights with the next observed value.
- A centered plot tracks the shape of the series and trails the newest observation by half the window. A plot closer to the newest bar can be preferred for a next-price estimate.
Three choices define the construction
A moving average is the arithmetic mean of N successive observations in a price or volume series, with each observation counted equally.
Three choices define the construction: window length, weighting scheme, and where the result is plotted against the source series.
When every observation has the same weight, the only free parameter is the window length N.
Window length
Window length is the count of observations N that enter one average.
There is no single agreed procedure for choosing N. Each stock or commodity series is often treated as having its own characteristic length.
A length that fit the last six months can later drift, for example from 5 toward 6. A fixed N is unlikely to remain suitable indefinitely for one series.
Weighting
When N is 5 and every observation has the same weight, each observation has a 20 percent share.
A weighted moving average scales each observation by its own weight before the total is divided by N. Unequal weights replace that equal share.
Those trial weights can be adjusted by comparing them with the next observed value.
Plot location
Plot location is the horizontal offset between the computed average and the source bars.
A centered moving average is plotted at the midpoint of the window that produced it, so the line tracks the shape of the source series. When N is 5, that midpoint is day 3. The centered plot follows the shape of the series but trails the newest observation by half the window.
A plot closer to the newest bar, day 4 when N is 5, can be preferred when the goal is a next-price estimate rather than a best visual fit.
Forecast extension
Forecast extension places the latest average one step ahead and feeds that value back into the next window.
Extending the last average one step ahead, then recycling that value as the newest observation, stays close when prices have been sideways and trails when they trend.