OPEN-SOURCE SCRIPT

Market Regime RSI Matrix

464
Market Regime RSI Matrix (MRM)

Market Regime RSI Matrix (MRM) is a multi-timeframe momentum and market context framework designed to transform traditional RSI analysis into a broader market regime model.

Rather than relying on a single RSI reading from the active chart timeframe, this indicator combines RSI measurements from multiple independent timeframes into a weighted composite engine called the Master RSI. It then evaluates the degree of agreement between those timeframes, estimates the persistence of the current market condition, classifies the prevailing market regime, and visualizes these relationships through adaptive momentum zones and dashboard components.

The objective of this script is not to generate isolated buy or sell signals, but to provide a structured view of how momentum is distributed throughout the market across multiple horizons.

📊 How It Works

The indicator is built around a hierarchical momentum framework composed of several interconnected modules.

Multi-Timeframe Master RSI Engine

At the core of the indicator is the Master RSI, a composite momentum value constructed from up to ten independent RSI calculations.

Each timeframe can be individually selected and assigned its own weight.

The composite value is calculated as:

Master RSI =
Σ(RSI × Weight) / Σ(Weight)

This allows shorter-term traders to emphasize lower timeframes, while swing traders can prioritize higher timeframe momentum.

Unlike traditional RSI implementations, the resulting Master RSI represents the collective behavior of multiple market participants operating on different time horizons.

🤝 Consensus Engine

Momentum strength alone does not necessarily imply broad market participation.

To address this, the script measures how many monitored timeframes agree on directional bias.

Each timeframe contributes to a bullish or bearish count according to whether its RSI is above or below the equilibrium level:

Bullish TF:
RSI ≥ 50

Bearish TF:
RSI < 50

Consensus is then calculated as:

Consensus Score =
|Bull TF − Bear TF| / Total TF × 100

Higher values indicate stronger alignment among market participants.

For example:

Consensus = 90%

9 timeframes bullish
1 timeframe bearish

suggests broad agreement across the monitored horizons.

Lower values indicate disagreement and fragmented market participation.

📈 Trend Strength Module

The indicator estimates momentum persistence by smoothing the Master RSI through two exponential moving averages:

Fast Trend EMA = EMA(Master RSI, 5)

Slow Trend EMA = EMA(Master RSI, 13)

The distance between these two curves provides an estimate of directional intensity.

Trend conditions are classified into:

• Weak

• Moderate

• Strong

• Very Strong

This framework helps distinguish between stable trends and environments where momentum lacks conviction.

🎯 Probability Engine

The Probability Engine combines several independent components into a unified score designed to estimate the persistence of the current market condition.

Inputs include:

• Consensus alignment

• Trend strength

• Master RSI positioning

• Dynamic Fibonacci context

The model aggregates these components using weighted contributions:

Probability Score =
Consensus × 40%
+ Trend Strength × 30%
+ Fibonacci Context × 20%
+ RSI Position × 10%

The resulting value is expressed as a percentage.

Higher scores indicate that the current market condition exhibits stronger internal agreement within the framework.

The Probability Score is intended as contextual information and should not be interpreted as a prediction of future price movement.

📐 Adaptive Fibonacci Momentum Zones

Instead of relying on fixed RSI thresholds such as 30 and 70, the script constructs dynamic Fibonacci zones using the observed Master RSI range.

The calculation window automatically adapts to the chart timeframe through the Adaptive Lookback Engine.

Typical lookback behavior:

Lower timeframes:
Longer observation windows

Higher timeframes:
Shorter observation windows

Standard Fibonacci ratios are then projected throughout the observed Master RSI range:

0.000
0.236
0.382
0.500
0.618
0.786
1.000

These zones serve as contextual momentum regions rather than predictive targets.

The indicator additionally estimates the corresponding price levels associated with each momentum zone, allowing users to compare momentum structure with actual price location.

🌡️ Multi-Timeframe RSI Heatmap

To improve readability, the script provides a visual heatmap displaying RSI values from every monitored timeframe.

Each row represents one timeframe and its current RSI value.

Color intensity reflects the relative position of the RSI within its momentum range, allowing users to quickly identify:

• Broad directional alignment

• Divergence between short-term and long-term momentum

• Emerging transitions in participation

The heatmap is intended to complement the Consensus Engine by providing a more granular view of internal market structure.

🧭 Market State Engine

One of the defining components of the framework is the Market State Engine.

Rather than describing conditions simply as bullish or bearish, the indicator classifies the market into five distinct regimes:

Bull Trend

Occurs when:

• Consensus is elevated

• Trend strength is positive

• Probability is high

• Master RSI maintains strong momentum

This environment suggests broad participation and directional persistence.

Bear Trend

Occurs when:

• Consensus is elevated

• Trend strength is negative

• Probability is high

• Master RSI reflects persistent downside momentum

This environment suggests coordinated selling pressure across timeframes.

Accumulation

Occurs when:

• Consensus is limited

• Probability remains subdued

• Master RSI operates below equilibrium

This condition may represent balance-building phases where directional conviction has not yet emerged.

Distribution

Occurs when:

• Consensus remains weak

• Probability remains subdued

• Master RSI operates above equilibrium

This condition may indicate loss of participation following sustained advances.

Transition

Any market environment not satisfying the criteria above is classified as Transition.

These phases often occur during regime changes, trend exhaustion, or evolving participation dynamics.

⚙️ Customization Options

Users can configure:

• Up to ten independent RSI timeframes

• Individual timeframe weights

• RSI calculation length

• Signal smoothing length

• Adaptive or manual Fibonacci lookback

• Fibonacci visualization settings

• Heatmap visibility

• Dashboard display preferences

This flexibility allows the framework to adapt to different asset classes, trading styles, and analytical objectives.

📖 How To Use

Possible applications include:

Use Consensus as a directional filter.

Higher Consensus values suggest broader market agreement.

Monitor Probability before acting on directional setups.

Increasing Probability may indicate strengthening market conditions.

Use Market State to identify the dominant regime.

Trend environments and transitional environments often require different decision-making approaches.

Observe the Heatmap for internal divergence.

Conflicting lower and higher timeframe momentum may signal weakening participation.

Use Fibonacci Momentum Zones as contextual reference areas.

These regions are intended to frame momentum behavior rather than provide precise price targets.

The indicator is designed to complement existing analytical processes and may be combined with price action, market structure, volume analysis, or individual risk management techniques.

💡 Originality

This script represents an original framework that integrates weighted multi-timeframe momentum aggregation, participation consensus measurement, adaptive momentum zoning, probability modeling, and market regime classification into a unified analytical dashboard.

Its primary innovation lies in treating RSI not as an isolated oscillator, but as a distributed representation of market participation across multiple horizons.

The combination of:

• Weighted Master RSI construction,

• Consensus-based participation analysis,

• Adaptive Fibonacci momentum zones,

• Composite probability estimation,

• Multi-timeframe heatmap visualization,

• and Market State classification,

forms a cohesive framework designed to improve contextual awareness rather than generate deterministic trading signals.

This complete implementation was developed as an integrated analytical model and is not derived from any previously published TradingView script.

⚠️ Disclaimer

This script is provided for educational and informational purposes only.

It does not constitute financial advice, investment advice, trading advice, or a recommendation to buy or sell any financial instrument.

All calculations are derived from historical market data and mathematical transformations of price behavior. Technical analysis is inherently uncertain, and past performance does not guarantee future results.

Users should conduct their own research and apply appropriate risk management before making trading decisions.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.