Market Regime Detector
Market Regime Detector V3 SINGULARITY identifies whether price is trending, ranging, squeezing, or shifting into a more volatile state. Its on-chart dashboard ranks the top three regime candidates and flags transition risk when another regime closely challenges the leader.
Live BTC preview
Read-only. The preview displays supported Pine plots on Apex OS market data.
Description
Market Regime Detector V3 SINGULARITY reads price and volume together to classify the current market. It combines trend strength, volatility, momentum, and market structure with statistics such as the Hurst estimate, variance ratio, return autocorrelation, and permutation entropy.
### See which regimes fit the current market
The engine ranks 33 candidates per evaluation, including trend strength, mean reversion, volatility storms, bull and bear traps, and breakout ignition. The dashboard shows the leading regime, its directional read, and up to two contenders that clear the minimum match threshold.
Each readout answers a different question. Match measures how closely the current market fits a regime's rules. Probability is the regime's relative weight across the full field of candidates. Confidence combines fit, how clearly the leader stands out, and the quality of the underlying evidence.
### Spot transitions and squeeze releases
A SHIFT warning appears when the second-ranked regime is a close challenger. The Family row shows how long the broader market state has held, and an optional background tint tracks that family across the chart. The squeeze engine measures how long compression lasts and flags Breakout Ignition when it releases with expanding volatility and a strong price move.
### Customize the dashboard and alerts
The quantitative row shows Hurst, permutation entropy, the five-bar variance ratio, lag-one autocorrelation, a determinism measure, and squeeze age. An optional row displays illustrative position-size, stop-loss, and take-profit multipliers for the leading regime.
TradingView alerts cover regime changes, entry into selected extreme regimes, the onset of transition risk, family shifts, and squeeze ignition. The detailed dashboard evaluates the latest bar, so its readings can change while the candle is forming.
How to use
- Open the script in TradingView and select Use on chart. To use the downloadable build, paste the
.pinefile contents into Pine Editor, save it, and select Add to chart. - Look for the Market Situation dashboard in the lower-left corner. Detection starts after the default 250-bar warm-up.
- Read Match, Probability, and Confidence together. Compare the leader with the second and third contenders, and check the Family row for persistence and the SHIFT warning.
- In Scoring, use Probability sharpness to adjust how strongly the probability weights favor the highest scores. Lower values concentrate more weight on the leaders. Use Min match % to list as contender to control which alternatives appear in the dashboard.
- Turn on Family background tint in Display to see broader state changes across the chart. For alerts, choose Regime family shift or Squeeze ignition by name. For detailed regime changes, extreme regimes, or transition-risk messages, select Any alert() function call and enable the corresponding options in the indicator settings.