OPEN-SOURCE SCRIPT
Quant H - TradeRR

Quant H - TradeRR
Quant H - TradeRR is a visual regime indicator that classifies market conditions into three states: Bull, Bear, and Sideways. It uses a rolling log-return model to label each bar, then builds a live transition matrix from chart history so you can see how likely the market is to remain in the current regime or shift into another one.
The core idea is simple: markets tend to move in persistent states, and those states can be measured. This script turns that into a clean on-chart framework by showing both the current regime and the probability structure behind it.
What it does
* Labels each bar as Bull, Bear, or Sideways
* Builds a live Markov transition matrix from visible chart history
* Highlights regime persistence through the diagonal probabilities
* Estimates the stationary distribution, showing the long-run regime mix
* Marks durable regime transitions directly on the chart
* Adds a subtle background ribbon so regime shifts are easy to spot visually
How to use it
* Best used on higher timeframes like 4H, Daily, and Weekly
* Works especially well on trending assets like indices, crypto, and liquid large caps
* Adjust the lookback window and thresholds to make regime detection tighter or looser
* Watch the diagonal of the matrix closely: higher diagonal values suggest stronger regime persistence
How to read it
* Bull: positive rolling return above the chosen threshold
* Bear: negative rolling return below the chosen threshold
* Sideways: anything in between
* Transition matrix: probability of moving from one regime to another
* Stationary distribution: the long-run baseline mix of Bull/Bear/Sideways regimes
Why it matters
Most indicators only tell you what price is doing now. This one helps frame what state the market is in, how sticky that state has been, and how often transitions happen. It is designed to support regime awareness, not replace your execution model.
Notes
* This is a probabilistic framework, not a prediction engine
* Results depend on the visible chart history and your chosen parameters
* Best used alongside structure, trend, volatility, and risk management
Disclaimer
This script is for educational and research purposes only. It is not financial advice.
Quant H - TradeRR is a visual regime indicator that classifies market conditions into three states: Bull, Bear, and Sideways. It uses a rolling log-return model to label each bar, then builds a live transition matrix from chart history so you can see how likely the market is to remain in the current regime or shift into another one.
The core idea is simple: markets tend to move in persistent states, and those states can be measured. This script turns that into a clean on-chart framework by showing both the current regime and the probability structure behind it.
What it does
* Labels each bar as Bull, Bear, or Sideways
* Builds a live Markov transition matrix from visible chart history
* Highlights regime persistence through the diagonal probabilities
* Estimates the stationary distribution, showing the long-run regime mix
* Marks durable regime transitions directly on the chart
* Adds a subtle background ribbon so regime shifts are easy to spot visually
How to use it
* Best used on higher timeframes like 4H, Daily, and Weekly
* Works especially well on trending assets like indices, crypto, and liquid large caps
* Adjust the lookback window and thresholds to make regime detection tighter or looser
* Watch the diagonal of the matrix closely: higher diagonal values suggest stronger regime persistence
How to read it
* Bull: positive rolling return above the chosen threshold
* Bear: negative rolling return below the chosen threshold
* Sideways: anything in between
* Transition matrix: probability of moving from one regime to another
* Stationary distribution: the long-run baseline mix of Bull/Bear/Sideways regimes
Why it matters
Most indicators only tell you what price is doing now. This one helps frame what state the market is in, how sticky that state has been, and how often transitions happen. It is designed to support regime awareness, not replace your execution model.
Notes
* This is a probabilistic framework, not a prediction engine
* Results depend on the visible chart history and your chosen parameters
* Best used alongside structure, trend, volatility, and risk management
Disclaimer
This script is for educational and research purposes only. It is not financial advice.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.