All indicators

Rolling Correlation & Breakdown Detector

By LuxAlgoFeb 16, 2026

Static chart image
OscillatorsCorrelationDashboard

The Rolling Correlation & Breakdown Detector is an advanced trading indicator built specifically for statistical arbitrage and pairs trading strategies. It acts as a real-time relationship monitor between two assets, helping traders determine whether a mean-reversion trading strategy is statistically valid or if the pair has entered a structural breakdown. Instead of generating direct buy or sell signals, this tool works as a powerful decision filter that protects traders from correlation regime shifts and failed spread trades.

How to Use the Rolling Correlation & Breakdown Detector in a Trading Strategy

This trading indicator is designed to be used alongside spread-based models such as Z-Score indicators, price ratio charts, or custom statistical arbitrage systems. Its primary purpose is to validate whether the relationship between two correlated assets remains stable enough to justify a mean-reversion trade.

Pairs trading and statistical arbitrage rely on one core assumption: two assets move together over time. When that relationship weakens or breaks, traditional mean-reversion signals can become traps. This indicator helps you avoid those traps.

The script continuously evaluates two critical components:

  • The raw Pearson rolling correlation
  • The stability of that correlation over time

By combining these two factors, the indicator functions as a “trust meter” for your pairs trading setup.

The Three-State Market Regime System

The Rolling Correlation & Breakdown Detector categorizes the relationship between two assets into three clear, color-coded states:

  • Healthy (Green):
    Correlation is strong and stable. This is the optimal environment for statistical arbitrage and mean-reversion strategies. Spread divergences are more likely to revert.

  • Warning (Orange):
    Correlation is weakening or becoming volatile. The relationship may be unstable. New trades should be taken cautiously, and existing positions should use tighter risk management.

  • Breakdown (Red):
    The correlation has collapsed or become erratic. The assets are no longer moving in tandem. In this regime, mean-reversion signals should be ignored, as one asset may be repricing independently due to structural or macro changes.

This three-state framework makes it easy to visually assess whether your trading strategy has a statistical edge at any given moment.

Filtering Statistical Arbitrage Trades

This trading indicator works best as a filter layered on top of your spread model.

  • Valid Trade Setup:
    Your spread indicator shows an extreme (e.g., Z-Score > 2)
    AND the detector is in the Green (Healthy) state.

  • Invalid Trade Setup:
    Your spread shows an extreme, but the detector is Red (Breakdown).
    This suggests a structural regime shift, where traditional mean-reversion logic is no longer reliable.

By applying this filter, traders can avoid the classic “divergence trap” — where a spread widens not because of temporary imbalance, but because the economic relationship between the two assets has fundamentally changed.

Why Correlation Stability Matters in Pairs Trading

Most traders focus only on the absolute correlation value. However, high correlation alone does not guarantee tradability.

A pair with:

  • Moderate but stable correlation
    can be more reliable for statistical arbitrage

than a pair with:

  • High correlation that is rapidly collapsing

This trading indicator introduces Correlation Stability as a core metric. It calculates the standard deviation of the rolling correlation over a defined Stability Window. If correlation fluctuates excessively, the stability metric spikes, triggering a Warning or Breakdown state.

This mechanism acts as a built-in “circuit breaker” for your trading strategy, helping protect against:

  • Macro-driven divergences
  • Earnings-related repricing
  • Structural news events
  • Regime shifts in sector or market behavior

When correlation becomes unstable, the probability of mean reversion decreases significantly. This tool makes that risk visible before it impacts your P&L.

Indicator Calculation Details

The Rolling Correlation & Breakdown Detector combines:

  • Rolling Pearson Correlation over a configurable lookback period
  • Standard Deviation of Correlation over a separate Stability Window

If:

  • Correlation drops below the Breakdown Threshold
  • OR stability volatility exceeds the Stability Threshold

the indicator transitions from Healthy to Warning or Breakdown.

This dual-layer logic ensures that both structural decay and erratic correlation behavior are captured — something traditional correlation overlays fail to address.

Settings Explained

General Settings

  • Asset B:
    The secondary symbol to compare against the current chart symbol.

  • Correlation Length:
    The rolling lookback window used to calculate Pearson correlation.

  • Stability Window:
    The lookback window used to measure correlation volatility (standard deviation).

Adjusting these inputs allows traders to tailor the indicator for short-term intraday statistical arbitrage or longer-term swing-based pairs trading strategies.

Breakdown Detection Thresholds

  • Healthy Threshold:
    Minimum correlation required to maintain a Healthy state.

  • Breakdown Threshold:
    Correlation level below which the relationship is considered structurally broken.

  • Stability Threshold:
    Maximum allowed correlation volatility before triggering Warning or Breakdown.

These thresholds let you control how strict the filter is. Lower thresholds create more trade opportunities but higher risk. Stricter thresholds reduce trade frequency while improving statistical reliability.

Dashboard Controls

  • Dashboard Toggle:
    Enables or disables the real-time on-screen information table.

  • Position / Size:
    Adjusts the location and scale of the dashboard for optimal chart layout.

The dashboard provides immediate insight into the current regime, correlation value, and stability metrics, helping traders make fast, data-driven decisions.

Who Should Use This Trading Indicator?

This tool is ideal for:

  • Statistical arbitrage traders
  • Pairs trading specialists
  • Market-neutral hedge strategies
  • Quantitative trading systems
  • Spread and ratio-based strategies

It is particularly valuable for traders who already use Z-Score models, spread bands, or custom arbitrage logic and want to improve risk control by validating correlation health.

FAQ

What is the Rolling Correlation & Breakdown Detector used for?

It is a trading indicator designed to monitor the health and stability of the relationship between two assets. It helps statistical arbitrage and pairs traders determine whether mean-reversion strategies are statistically valid or if the correlation has broken down.

Is this a standalone entry signal indicator?

No. It functions as a decision filter. It should be combined with spread indicators, Z-Score models, or other statistical trading strategies.

Why is correlation stability important?

A stable correlation indicates a persistent relationship between assets. If correlation becomes volatile or collapses, the probability of successful mean reversion decreases significantly, increasing the risk of failed trades.

How do I access the Rolling Correlation & Breakdown Detector?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.