Machine Learning: kNN-based Strategy stores normalized historic indicator values and past directions, then compares the current point to the nearest neighbours using Euclidean or Chebyshev distance. Users choose RSI, ROC, CCI, volume, or all of them, plus short and long periods, neighbour count, a date window, an optional volatility filter, and a clear state. It overlays signals on the price chart. Signals repaint.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Start Date
time
timestamp('01 Jan 2000 00:00:00 GMT+10')
StartDate
Stop Date
time
timestamp('31 Dec 2025 23:45:00 GMT+10')
StopDate
Distance Metric
string
Euclidean
Dist
Indicator
string
All
Indicator
Short Period [1..n]
int
14
Short
Long Period [2..n]
int
28
Long
Base No. of Neighbours (K) [5..n]
int
252
BaseK
Volatility Filter
bool
false
Filter
Add CLEAR State
bool
false
Clear
Lookback
int
1
Lookback
Trades Max Bar Count [2..5000]
int
500
Bars
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This indicator uses a Lorentzian distance k-nearest neighbors classification algorithm to predict market direction based on up to five technical features, such as RSI, WaveTrend, CCI, and ADX. It compares current feature values against historical bar patterns
An overlay indicator that applies a k-nearest-neighbors machine learning classifier using Lorentzian distance to predict price movement. It evaluates historical market features, such as RSI, WaveTrend, CCI, and ADX, to identify similar price-time patterns and
The Machine Learning Momentum Index uses a k-Nearest Neighbors classification algorithm to evaluate momentum and trend direction directly on the price chart. It records historical parameter pairs derived from weighted moving averages and smoothed RSI values, t
This indicator plots an oscillator in a separate pane. It builds several SuperTrend series across a user-defined factor range and step, using ATR as the band width. On each bar it measures the distance between the close and each SuperTrend output, then groups
Lorentzian Classification is a machine learning indicator that applies a k-nearest neighbors algorithm using Lorentzian distance to analyze market patterns. It processes configurable technical indicators, including RSI, WaveTrend, CCI, and ADX, as feature vect
The Adaptive RSI Moving Average (ARSIMA) is an overlay indicator that dynamically adjusts its smoothing factor based on the Relative Strength Index (RSI). When the RSI moves toward extreme overbought or oversold conditions, the smoothing factor increases to ma