KNN Classification of Price Slopes Near Historical Pivot Points
Summary
This indicator estimates whether current price action resembles the historical slope patterns associated with pivot highs or lows. It detects confirmed pivots, stores regression slopes around those events, and compares the current rolling close slope with the stored high and low slope samples. The average distance to a configurable number of nearest samples determines whether the display labels conditions as approaching a pivot high or low, with a relative confidence value.
The chart marks transitions from neutral conditions and includes tables reporting historical success rates and average moves. These figures are computed within the script from its recorded transitions, but the document gives no independent validation, sample breakdown, or evidence that the classifier predicts future pivots reliably. Pivot confirmation itself requires bars on both sides, so the historical pivot labels are delayed. The implementation also hard-codes a ten-bar pivot width despite exposing a bars-left/right input, a detail that limits the apparent configurability.
Key ideas
- The classifier compares current rolling price slope with slopes stored around historical pivot highs and lows.
- Nearest-sample distances determine the directional label and a relative confidence measure.
- The indicator displays historical transition statistics and average moves, without independent validation.
- Pivot confirmation uses future bars relative to the pivot point, so labels are inherently delayed.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.