2001issue C111-2
Constructing nearest-neighbor forecasts gated by a trend filter
A nearest-neighbor forecast locates historically similar patterns and averages those neighbors’ subsequent moves to estimate the current pattern’s next move. Analog ranking and a period-based trend-detection status can be built as separate modules and then composed when constructing a gated forecast.
- A nearest-neighbor forecast estimates the current pattern’s next move by averaging the subsequent moves of historically similar neighbors.
- Each pattern element can carry its own importance weight, and closer analogs can be distance-weighted with a decay that may differ by element.
- The lookback that defines the pattern window can be fixed by the builder or searched jointly with which series and parameters enter the pattern.
- Analog ranking and a period-based trend-detection status can be built as separate modules and then composed into a gated forecast.
How the forecast is formed
A nearest-neighbor forecast is built by locating historically similar patterns and averaging those neighbors’ subsequent moves to estimate the current pattern’s next move. Historical analog comparison ranks earlier windows of ordered observations by distance from the current window and uses the neighbors’ subsequent moves as the forecast raw material.
Treat the lookback as a searchable pattern
Pattern recognition treats a chosen lookback of prices or derived series as a multi-element signature that can be matched, classified, or assigned element-level importance. The ordered inputs that form the pattern may be past prices or other series such as oscillators and moving averages, so each pattern element can be assigned a distinct importance weight.
The lookback that defines the pattern window can be fixed by the builder or searched jointly with which series and parameters enter the pattern.
Rank analogs and form the next-move estimate
Neighbor contributions can be scaled so closer analogs receive more weight than distant ones. Distance-weighting applies that scaling, and the decay of weight with distance can be set separately for each pattern element.
Classify instead of estimating a next move
The same analog machinery can classify the current pattern into discrete act-or-stand-aside states instead of emitting only a continuous next-move estimate.
Weekly Adaptive Net Indicator one-year account returns

Optimal and Current backtests were identical for return, trade count, winners and losers. The All-instruments row is the three-name average return (112.8%) and is omitted so the bars show only the named stocks.
One weekly construction path
One construction path writes ordered weekly closes, optionally as the natural logarithm of the close, ranks analogs in a table after skipping the current bar, then marks the five nearest neighbors back on the price series.
Build the trend filter as its own module
A trend filter is a directional gate assembled from the signed and absolute close displacement over a chosen period. The construction compares the one-window and two-window sums of those displacements and holds the prior directional state when the index is not positive.
Compose the gated forecast
Analog ranking of a current price pattern and a period-based trend-detection status can be built as separate modules and then composed when constructing a gated forecast.
All readings on this track · 19 readings
- 1988Crash fear fails the depression regime test
- 1990October 1987 cycle overlay and the loss-trap
- 1990Constructing nested four-year market cycles
- 1991Evaluating quarterly return runs with historical analogs
- 1992Evaluating split events across correction and bear regimes
- 1993Mining-bullion relative strength as a gold-sleeve regime
- 1994A two-horizon case study of a market-breadth oscillator
- 1994Extreme short-rate declines as equity regime context
- 1997Clustered true-range days as a regime label rather than a top forecast
- 2001Nearest-neighbor one-week forecast from log-price patterns
- 2001Constructing nearest-neighbor forecasts gated by a trend filter
- 2003Regime context for debt-era bear rallies
- 2004Testing a 1987 stock and gold analog by wave degree
- 2004Shifting calendar regimes and election-cycle analogs
- 2006Aligning sugar boom phases with seasonal analogs
- 2009Crowd consensus and failed targets as regime context
- 2011Treat a long-horizon chart analog as a regime scenario
- 2012Build a weekly analog as a dated forecast object
- 2015From a drawn price shape to an event-cloud case study