1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
Features are z-score normalised, optionally compressed with principal component analysis, and compared with a rolling training window using a Minkowski distance. Past bars are labelled bullish, bearish or neutral by what happened over a momentum window, and a signal needs a probability above a set threshold. It also offers bar coloring, a trend EMA and a performance table.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
K-Neighbors (K)
int
5
k_neighbors
Learning Window Size
int
400
window_size
Prediction Threshold
float
0.9
prob_threshold
Momentum Window
int
4
momentum_window
Short RSI Period
int
2
rsi_short_len
Mid RSI Period
int
3
rsi_mid_len
Long RSI Period
int
4
rsi_long_len
Short MA Period
int
2
ma_short_len
Medium MA Period
int
3
ma_medium_len
Long MA Period
int
4
ma_long_len
Signal Line Period
int
4
signal_len
Minkowski Parameter (p)
float
2.0
p_param
Show all 16 settings
Setting
Type
Default
Variable
Enable PCA Compression
bool
true
use_pca
Dynamic Bar Coloring
bool
true
use_bar_color
Show Model Performance Table
bool
true
show_table
Trend Filter (EMA)
int
20
ema_len
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
This indicator applies a k-nearest neighbours (kNN) classification algorithm using Aroon indicator lags and momentum as feature inputs to forecast market direction. It compares current values against historical feature sets to classify bars into buy, hold, or
This indicator classifies the current bar by comparing its feature vector with historical bars using Lorentzian distance and a k-nearest-neighbors vote. Configurable features include RSI, WaveTrend, CCI, and ADX. Optional volatility, regime, ADX, and EMA filte
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
Farid Makram Custom Levels is a multi-signal indicator for TradingView that combines RSI momentum analysis with MOBO oscillator signals based on the DPO. It generates buy and sell signals when RSI crosses its moving average or when DPO crosses zero, with confi
An overlay that marks long and short signals by combining a Money Flow Index with k-means derived overbought and oversold levels, and an Andean oscillator crossing its signal line, both within a confirmation window. Optional trend and ATR percentage filters ca