Skip to content
All library documents

Scoring Market-Structure Breaks with K-Nearest Neighbors

Article ProRealCode

Summary

This indicator applies a nearest-neighbor method to Change of Character (CHoCH) breaks in market structure. It detects swings with centered pivots, records a break when price crosses the last relevant swing in a direction that changes the trend state, and describes each event with volume pressure, ATR-scaled displacement, and move velocity. For a new break, it compares those features with past events of the same direction and uses the closest cases to estimate the share that resolved favorably.

Past cases receive labels after a fixed lookahead period, based on whether the maximum favorable excursion exceeded the maximum adverse excursion. The favorable runs of selected neighbors also inform three projected target levels, while a minimum score can filter signals. The document describes the indicator’s displays and parameters, but provides no independent backtest or evidence that the method predicts future performance. Scores and targets depend on the instrument’s accumulated history, feature choices, and labeling horizon; a small historical database may make estimates less informative.

Key ideas

  • The indicator treats a trend-state change through a swing level as a CHoCH event.
  • Each break is represented by volume pressure, ATR-scaled displacement, and velocity features.
  • A K-nearest-neighbor lookup compares new breaks with historical events in the same direction.
  • Historical cases are labeled by comparing favorable and adverse price excursions after a fixed horizon.
  • Neighbor outcomes produce a continuation score and three target projections, whose reliability depends on available history.

Tags

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