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
Three standardised inputs, trend, volatility and ADX, are scored against configurable regime means and variances that can be pasted from an external training step. A self-transition probability sets how sticky regimes are, with an optional session boost outside 07:00 to 17:00 UTC and an optional VIX confidence overlay. Bars can be coloured by regime and an information table is available.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
BULL means [trendZ,volZ,adxZ]
string
1.0,0.0,0.7
i_bull_means
BEAR means [trendZ,volZ,adxZ]
string
-1.0,0.0,0.7
i_bear_means
RANGE means [trendZ,volZ,adxZ]
string
0.0,0.0,-1.0
i_range_means
CHOP means [trendZ,volZ,adxZ]
string
0.0,1.0,0.0
i_chop_means
BULL vars [trendZ,volZ,adxZ]
string
1.0,1.0,1.0
i_bull_vars
BEAR vars [trendZ,volZ,adxZ]
string
1.0,1.0,1.0
i_bear_vars
RANGE vars [trendZ,volZ,adxZ]
string
1.0,1.0,1.0
i_range_vars
CHOP vars [trendZ,volZ,adxZ]
string
1.0,1.0,1.0
i_chop_vars
Self-prob (avg diagonal A matrix)
float
0.90
i_self_prob
Sticky outside 07:00–17:00 UTC
bool
true
i_session_boost
Apply VIX confidence overlay
bool
true
i_vix_overlay
VIX symbol
string
CBOE:VIX
i_vix_src
Show all 14 settings
Setting
Type
Default
Variable
Show info table
bool
true
i_show_table
Colour bars by regime
bool
true
i_bar_col
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 combines a dynamic Seasonal Random Index (SRI) with a dynamic Karobein Oscillator and a pattern-similarity search algorithm in a separate pane. It normalizes SRI into seasoned and deseasoned series, shading the area green or red to signal trend
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
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
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
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