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
Each factor is scored with an exponential performance memory. K-means clustering groups those results, and the user chooses the best, average, or worst cluster for the displayed trail. Style options cover trailing-stop and AMA colors, candle coloring, and signals. A dashboard can show cluster information at a chosen corner and text size. Iteration count and historical bar depth limit the calculation.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
ATR Length
int
10
length
Factor Range
int
1
minMult
maxMult
int
5
maxMult
Step
float
.5
step
Performance Memory
float
10
perfAlpha
From Cluster
string
Best
fromCluster
Maximum Iteration Steps
int
1000
maxIter
Historical Bars Calculation
int
10000
maxData
Trailing Stop
color
color.red
bearCss
bullCss
color
color.teal
bullCss
AMA
color
color.new(color.red, 50)
amaBearCss
amaBullCss
color
color.new(color.teal, 50)
amaBullCss
Show all 17 settings
Setting
Type
Default
Variable
Candle Coloring
bool
true
showGradient
Show Signals
bool
true
showSignals
Show Dashboard
bool
true
showDash
Location
string
Top Right
dashLoc
Size
string
Small
textSize
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 Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e
This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w
Markov State Engine classifies market conditions into six distinct regimes, including strong trends, weak trends, compression, and expansion. It evaluates historical state transitions using an exit-conditional Markov model with Laplace smoothing to estimate re
This indicator classifies the market into gamma regime types (negative gamma trend, positive gamma mean-reversion, or transition) by calculating a composite score based on daily ATR ratios, session VWAP crossover frequencies, and opening range displacement. It
This indicator calculates standardized trend strength and historical volatility to estimate position sizes. It computes the differences between three user-defined EMAs standardized by price using MACD logic, while historical volatility is derived from the stan
Dynamic Extreme Channels & Reversals tracks evolving price highs and lows to plot adaptive channel bands and a midline directly on the price chart. When no new extremes occur within the specified lookback window, the channel boundaries interpolate toward price