Skip to main content
Track Weighted moving average
17 / 20
Library

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.
Entries in this reading3 entries

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

On daily Microsoft bars the 20-bar linear-regression endpoint turns with price while the same-length simple average lags through the mid-2002 swings. Dollar levels were read from the NeuroShell daily screenshot of Moving Trend(Close,20) against Avg(Close,20).
On daily Microsoft bars the 20-bar linear-regression endpoint turns with price while the same-length simple average lags through the mid-2002 swings. Dollar levels were read from the NeuroShell daily screenshot of Moving Trend(Close,20) against Avg(Close,20).MSFT · Daily · 2002-04-22T00:00:00.000Z to 2002-11-08T00:00:00.000Z

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.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
17 of 20 in the Weighted moving average track
20041-11 pp.Next on Weighted moving averageConstructing a volume-weighted moving average as a forecast baselineA volume-weighted moving average sums each bar's price multiplied by that bar's volume over a chosen lookback, then divides by the total volume in the same lookback.
All readings on this track · 20 readings
  1. 1988Indicator smoothing: lookback, weight, and scale
  2. 1990Recency weighting in simple, linear, and exponential moving averages
  3. 1990Seed and recurrence construction for moving averages
  4. 1990Constructing a five-day step-weighted moving average
  5. 1992Constructing simple, weighted, and exponential moving averages
  6. 1992Constructing moving averages with weighting schemes and extra filters
  7. 1992Constructing a weighted-average TRIN10 with Bollinger envelopes
  8. 1992Constructing a banded weighted open-TRIN oscillator
  9. 1993Evaluating a weighted dual rate-of-change momentum filter
  10. 1993Constructing equal, linear and exponential moving averages
  11. 1993Constructing a general weighted moving average from one exponent
  12. 1993Calibrating the weighted-moving-average exponent
  13. 1993Constructing an exponent-weighted average of put-call ratios
  14. 1994Cycle-tuned momentum with spectral peaks
  15. 1999How a five-bar sine-weighted average is assembled
  16. 2003Same-scale trend filter from a rolling least-squares endpoint
  17. 2003How a rolling linear-regression endpoint is assembled as a moving-trend
  18. 2004Constructing a volume-weighted moving average as a forecast baseline
  19. 2005Constructing a move, volume and recency weighted average
  20. 2016MACD as a zero-line filter with dual moving averages
All 24 readings tagged Weighted moving average
Also on Weighted moving average5 readings