This overlay indicator scores a bull, bear, or neutral game state from an auditable decision-forest probability rather than a fitted machine-learning model or live API.
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
Regime Game Probability Forest compares the smoothed probability with bull and bear thresholds, then shifts it when a strong intervention-flow regime is active. Regime data come from manual flow inputs or a four-ETF basket proxy. It colors candles, highlights the regime, labels state changes, and shows a dashboard. It does not place trades.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Bull game threshold
float
0.60
bullThreshold
Bear game threshold
float
0.40
bearThreshold
Probability EMA smoothing
int
3
probabilitySmoothing
Intervention flow probability shift
float
0.08
flowProbabilityShift
Walk-forward training window
int
400
trainingWindow
Calibration refresh bars
int
20
retrainEveryBars
Minimum samples per probability bin
int
6
minimumBinSamples
Walk-forward calibration weight
float
0.60
calibrationWeight
Regime source
string
Manual API values
regimeSource
API net flow, CNY bn
float
0.0
manualNetFlowBn
API basket AUM, CNY bn
float
1000.0
manualBasketAumBn
API historical flow z-score
float
0.0
manualFlowZ
Show all 29 settings
Setting
Type
Default
Variable
API strong-event flag
bool
false
manualVendorStrong
API value effective from
time
timestamp("01 Jan 2024 00:00 +0800")
manualEffectiveTime
Strong absolute flow, CNY bn
float
5.0
absoluteFlowThresholdBn
Strong flow/AUM ratio, bps
float
20.0
flowRatioThresholdBps
Strong flow z-score
float
2.0
flowZThreshold
ETF 1
symbol
SSE:510300
etf1
ETF 2
symbol
SSE:510050
etf2
ETF 3
symbol
SSE:510500
etf3
ETF 4
symbol
SZSE:159919
etf4
Proxy intervention threshold
float
2.0
proxyZThreshold
Color candles by game state
bool
true
showBarColors
Highlight intervention regime
bool
true
showRegimeBackground
Show probability on state changes
bool
true
showTransitionLabels
Show periodic probability labels
bool
false
showPeriodicLabels
Periodic label interval
int
20
periodicLabelBars
Labels only after candle close
bool
true
confirmedLabelsOnly
Show dashboard
bool
true
showDashboard
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
This overlay indicator builds many SuperTrend trailing stops across a user-set ATR length, factor range, and step. Each factor is scored with an exponential performance memory. K-means clustering groups those results, and the user chooses the best, average, or
The AI Dynamic Liquidity Engine indicator detects swing highs and lows on the price chart to identify potential liquidity zones. It tracks swing points in arrays and validates each zone by counting proximity tests based on recent price action. When a zone reac
This indicator overlays a weighted ensemble of three models on the price chart. It compares the current bar with historical bars using RSI, volume ratio, price change and range position, then blends that KNN vote with a linear-regression projection and an EMA-
This indicator calculates and plots a multi-factor order-flow analysis using tick counts, volume ratios, big player volume, recent delta momentum, and a K-nearest neighbors pattern matching algorithm. It evaluates bull and bear thresholds across multiple weigh