Skip to main content
Track Moving-average crossover
20 / 57
Library

1998issue C041-7

Constructing r-squared trend filters with dual lookbacks

A least-squares linear regression of price on time publishes slope, a fitted forecast, the standard error of the estimate, and r-squared. High r-squared was treated as a linear-trend state that can gate a later directional overlay, including two r-squared lookbacks stacked the way a moving-average crossover stacks two averages.

  • A linear regression of price on time returns slope, a fitted forecast, the standard error of the estimate, and r-squared. A simple moving average smooths noise but does not report those quantities.
  • R-squared is bounded between 0 and 1. High readings were treated as a linear-trend state and low readings as a nontrend or range state, so the statistic can gate which methods apply.
  • A 30-session lookback was the shortest window used without a small-sample correction. Two r-squared series at 21 and 63 sessions were stacked so the shorter fit cycles inside the longer fit.
  • Because r-squared does not sign direction, slope coloring and percentage residuals were applied only after a 0.70 fit threshold. Neither a straight-line regression nor a moving average supplies a uniquely correct lookback.
Entries in this reading3 entries

Editorial: treat trend as a two-stage construction problem rather than a chart slogan. The first stage is a least-squares linear regression of price on time. That fit returns slope, a fitted forecast, the standard error of the estimate, and r-squared. The second stage is a directional overlay, and it is allowed to speak only after r-squared has been published as a trend filter.

What the fit publishes

A linear regression of price on time is estimated by least squares. Besides the slope of the fitted time line, the estimate returns a fitted forecast, the standard error of the estimate, and r-squared.

R-squared is a zero-to-one goodness-of-fit reading. It states how much of the observed price path is explained by the fitted time line.

What a moving average leaves out

A simple moving average smooths noise but does not report slope, goodness of fit, or forecast error. A 20-session average is conceptually centered 10 sessions back, and the lookback is chosen arbitrarily.

R-squared as a published trend filter

R-squared is bounded between 0 and 1. High readings were treated as a linear-trend state and low readings as a nontrend or range state. The statistic can gate whether trend-following or range methods apply.

On a 30-observation sideways close series the fitted r-squared was 0.00014. On a steadily rising series it was 0.95.

Lookback, thresholds, and runs

A 30-session lookback was used as the shortest window that does not require a small-sample correction. Shorter windows need that correction. Longer windows lose short-horizon responsiveness.

In a 30-day linear-regression sample of a broad equity index from August 1988 to summer 1997, r-squared above 0.70 was labeled a good fit and r-squared below 0.30 a poor fit. Readings in the trending band occurred about 35 percent of the time.

Consecutive sessions with r-squared above 0.70 were counted as a trend run. The longest such run in that sample lasted 65 sessions. The longest stretch below 0.70 lasted 204 sessions.

Direction after the filter

Because r-squared does not sign direction, bars were colored by regression slope once r-squared reached 0.70.

Signed percentage residuals were plotted as an early-warning overlay on the completed lookback. Each residual is the signed gap between actual and predicted price, expressed as a percent of the prediction: actual minus predicted, divided by predicted, times 100.

Two lookbacks stacked like averages

Two r-squared series with 21-session and 63-session lookbacks were stacked the way moving-average crossovers stack two averages. The shorter fit cycles inside the longer fit.

Limits of a straight-line fit

A straight-line regression cannot describe an exponential or parabolic path. Neither regression nor a moving average supplies a uniquely correct lookback length.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
20 of 57 in the Moving-average crossover track
19981-5 pp.Next on Moving-average crossoverMoving-average length is a habit, not a secretA moving average is a line of averaged closing prices over a chosen lookback and is used as a trend marker and as a reference for support, resistance, and breakouts.
All readings on this track · 57 readings
  1. 1988Constructing moving averages: weights, smoothing and crossovers
  2. 1988Constructing breadth and average trend states
  3. 1989Evaluating an always-in-the-market moving-average crossover
  4. 1989Constructing symmetric market-breadth ratio accumulators
  5. 1989Objective crossover tests of Fibonacci wave ratios
  6. 1990Volume-adjusted moving average construction
  7. 1991Constructing a mechanical crossover on a synthetic price series
  8. 1991A two-speed breadth reading for intermediate market direction
  9. 1992A Deutschemark yield map with dual-average and relative-strength timing
  10. 1992Confirming currency-fund trends with a crossover and a filter
  11. 1992A moving-average slope filter for crossover signals
  12. 1992Occupancy and split-sample tests for average crossovers
  13. 1994Gold-mining seasonality and bond-fund duration switching
  14. 1994Price oscillator from two moving averages
  15. 1995Explicit exponential weights and binary entry filters
  16. 1996Currency futures crossover with slope, bond filter, and stop
  17. 1996Two-market average crossover entry with a fixed stop
  18. 1997Construction of a filtered three-average crossover
  19. 1998Two-group exponential average compression as a trend filter
  20. 1998Constructing r-squared trend filters with dual lookbacks
  21. 1998Moving-average length is a habit, not a secret
  22. 1999Solving the close that triggers a moving-average crossover
  23. 2000Kagi yang and yin control versus crossover noise
  24. 2000Constructing simple moving average crossover filters
  25. 2000Building a vertical-horizontal filter to gate trend signals
  26. 2000Two-average crossover as a check on trend following
  27. 2003Stacked exponential-average retracement entries and extreme stops
  28. 2003Evaluating oscillator thresholds against optimized crossovers
  29. 2004Constructing a semicycle trend-quality filter
  30. 2004Commodity subgroups labeled by crossover, support, or convergence
  31. 2004Full-window evaluation of crossover trend systems
  32. 2004Two-average trend filters as a classroom critique of indicator stacking
  33. 2005Three-layer confirmation from a moving-average cross, candles, and Q-stick
  34. 2005Charting put prices beside an equity breakdown
  35. 2005Range-gated moving-average crossover construction
  36. 2007Anticipating a simple-average crossover with a threshold-close
  37. 2007Anticipating moving-average crossovers one bar ahead
  38. 2007Lead-series moving-average crossovers with a stochastic and relative strength index
  39. 2007Next-bar SMA crossover hypotheses from theoretical crossing values
  40. 2007Anticipating a moving-average crossover before confirmation
  41. 2007A three-horizon moving-average stack as a construction problem
  42. 2007Confirming trend with regression slope and r-squared
  43. 2008Constructing a multi-timeframe smoothed crossover
  44. 2008Best-day clusters versus trend filters
  45. 2008Allied markets as a confirmation gate for crossover and breakout signals
  46. 2008Weekly exponential-average crossover as a mechanical trend case study
  47. 2010Evaluating a 200-day crossover as long, short, and stand-aside rules
  48. 2010Read a 10-and-40 trend on two neighboring time frames
  49. 2012Sampling unit as a first-class parameter on dual simple moving averages
  50. 2012Constructing index-ETF entries from volatility-index persistence
  51. 2013Moving-average baselines versus crossover signals
  52. 2013Constructing a typical-price and heikin-ashi crossover as one mechanical procedure
  53. 2016A three-gate checklist for longs after a sharp drop
  54. 2016Weekly inflation-ratio crossover for commodity regimes
  55. 2017Normalized Laguerre zero-axis warning as a two-marker construction
  56. 2019Range-weighted construction of an adaptive exponential moving average
  57. 2020Construct a second-pullback entry after a moving-average crossover
All 108 readings tagged Moving-average crossover
Also on Moving-average crossover5 readings