Skip to content
All library documents

A Weighted-Average Approximation to the Least-Squares Moving Average

Article TradingView scripts

Summary

The article derives a compact way to calculate a least-squares moving average (LSMA), a linear-regression-based smoother intended to track price trend with less lag than a simple average. It explains that the LSMA can be represented as a linear regression over time and relates its filter weights to those of a weighted moving average (WMA) and a simple moving average (SMA). The proposed expression is three times the WMA minus twice the SMA over the same source and window, which can also be written as the WMA plus twice the difference between WMA and SMA.

The author compares the proposed calculation with the conventional LSMA and reports that their plotted difference is effectively zero at the displayed precision, attributing any residual to rounding. No systematic tests across assets, window lengths, or market regimes are provided. The discussion notes that LSMA can be used as a smoother, while forecasting from its fitted line is rarely accurate; the construction is a calculation shortcut, not a trading strategy or evidence of predictive performance.

Key ideas

  • The LSMA fits a linear trend over a rolling window and is often used as a smoother.
  • The proposed calculation combines a WMA and SMA as three times WMA minus twice SMA.
  • The derivation uses the relationship between their filter weights and the LSMA impulse response.
  • The author reports near-zero difference from the standard calculation at displayed precision.
  • The article offers no trading results and cautions that LSMA forecasts are rarely accurate.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.