2003issue C011-11
How a rolling linear-regression endpoint is assembled as a moving-trend
A moving-trend series takes the current-bar endpoint of a linear-regression of close and can be drawn next to a moving-average and a weighted-moving-average so the three smoothers stay visible as construction choices.
- A moving-trend is the current-bar value of a linear-regression of close over a fixed lookback, used as a price smoother rather than as a lagged average.
- The same window can also produce a moving-average of close so both series can be drawn on one chart, and separate regressions of open, high, low, and close can be plotted as surrogate-bars.
- A shorter linear-regression lookback, a weighted-moving-average written as a fixed combination of recent closes, and a spreadsheet with adjacent columns keep the construction differences in view.
- The same moving-trend definition is also assembled as a closed-form sum over a 20-day window and as a least-squares end-point modifier on a 5-day window.
A smoother from the current-bar endpoint
A moving-trend is a rolling linear-regression endpoint used as a price smoother over a fixed lookback. The linear-regression is a least-squares fit to ordered price observations, and the current-bar endpoint becomes the filter value.
A moving-trend series can be built by taking the current-bar value of a linear-regression of close over a 20-bar lookback.
The same window as a moving-average
The same 20-bar window can also produce a simple moving-average of close so both smoothers can be drawn on one chart. The moving-average is an equal-weight average of prices over that lookback and is used as a baseline smoother.
Surrogate-bars from four regressions
Applying the same 20-bar regression separately to open, high, low, and close yields four series that can be plotted as surrogate-bars. Open, high, low, and close are each replaced by their own rolling regression endpoints so the result can be drawn as candles.
Shorter lookbacks of the same endpoint
A 7-bar linear-regression of close can be constructed in the same way as the 20-bar version for a shorter lookback comparison. A least-squares end-point modifier on a 5-day window is treated as equivalent to the moving-trend definition.
A weighted-moving-average on a short window
A 7-bar weighted filter can be written as a fixed linear combination of the current close and the prior six closes. A weighted-moving-average assigns more weight to recent prices than a simple average.
How platforms and a spreadsheet assemble the same idea
TradeStation implementations treat the moving-trend as a linear-regression smoother rather than a lagged average. An AIQ construction uses a 20-day window and a closed-form sum to obtain the moving-trend value from close.
One spreadsheet construction places a 20-bar simple average, a 20-bar linear-regression, and a 20-bar weighted-moving-average of close in adjacent columns.
Microsoft 20-bar moving trend versus 20-bar average

Both smoothers use the 20-bar window printed in the chart legend. Point values are visual readings from the labeled price scale, so turning levels are approximate to about a tenth of a dollar.
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