Skip to content
All library documents

KNN Trend Indicator Using Historical Price Similarity

Article ProRealCode

Summary

The AI Trend Navigator is a ProRealTime indicator that applies a nearest-neighbor approach to price-derived series. It compares a current target value with values in a historical window, selects the closest matches, and averages them into a smoothed classifier line. Users can select different input calculations, including price averages and volume-weighted average price, and adjust the number of neighbors and smoothing period. The line’s slope is displayed with different colors, while an optional background represents a directional prediction based on comparisons with recent patterns.

The article explains the indicator’s settings and provides code, but supplies no test results, accuracy measures, or evidence that its directional colors forecast returns. It describes the output as trend and reversal guidance, so users should treat it as an indicator concept rather than a demonstrated predictive model. The method depends on its chosen price inputs, historical window, and parameter settings; the document does not discuss transaction costs, out-of-sample validation, or how to turn signals into a complete trading strategy.

Key ideas

  • The indicator compares a current target with historical values and averages the closest matches.\nInput sources, neighbor count, and smoothing can be configured.\nThe classifier line’s slope provides a colored trend display, with an optional prediction background.\nThe article provides implementation details but no evidence of predictive accuracy or trading performance.\nThe indicator alone does not specify a complete strategy or address costs and validation.

Tags

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