OPEN-SOURCE SCRIPT

Market Risk Regime Dashboard (SPX/VIX)

34
Market Risk Regime Dashboard (SPX–VIX)
Market Risk Regime Dashboard (SPX–VIX) is a context and confirmation tool designed to classify market conditions as Risk-On, Risk-Off, or Neutral by analyzing the real-time relationship between the S&P 500 Index (SPX) and the CBOE Volatility Index (VIX).
Rather than predicting price direction, this script focuses on identifying market environment and participation conditions that often influence trade quality, position sizing, and strategy selection.
Core Concept: SPX vs VIX Risk Regimes
The indicator operates on a well-documented market relationship:
SPX reflects equity risk appetite and directional participation
VIX reflects implied volatility and risk aversion
The script classifies conditions as:
Risk-On → SPX bullish and VIX falling
Risk-Off → SPX bearish and VIX rising
Neutral → Any mixed or non-aligned condition
This alignment is visualized using:
Background color on the chart
A compact dashboard table
Optional alerts
Trend Strength via Normalized EMA Distance (n-Value)
To quantify trend strength, the script computes a normalized trend metric (“n-value”) for SPX:
A fast EMA and slow EMA are calculated on SPX
The absolute distance between the EMAs is measured
That distance is normalized by an ATR-based volatility measure
The result is a dimensionless value that expresses trend strength relative to volatility, allowing comparisons across timeframes.
Higher n-values indicate stronger directional conditions, while lower values suggest compression or range behavior.
Dashboard Display
A movable on-chart table summarizes:
SPX directional bias (Bullish / Bearish / Neutral)
VIX behavior (Rising / Falling)
SPX n-value trend strength
This allows traders to quickly assess market context without switching symbols or charts.
Strong Candle Detection (SPX)
The script identifies strong directional candles on SPX using objective criteria:
Candle body must represent a minimum percentage of total range
Close must occur near the extreme (high for bullish, low for bearish)
Direction must align with candle body
When detected:
A triangle marker is plotted
The chart bar is optionally colored
Additional alerts can trigger when strong candles align with Risk-On or Risk-Off regimes
These signals are intended to highlight initiative participation, not standalone entries.
Visual & Alert Features
Background color reflects current risk regime:
Green = Risk-On
Red = Risk-Off
Gray = Neutral
Alerts available for:
Risk-On alignment
Risk-Off alignment
Neutral conditions
Strong candles aligned with risk regime
Elevated normalized trend strength (n-value range)
Alerts can be used for situational awareness rather than execution triggers.
How Traders Typically Use This Script
Filter trades based on broader market risk context
Adjust aggressiveness or size during Risk-On vs Risk-Off regimes
Confirm directional conviction when price action aligns with volatility behavior
Avoid forcing trades during neutral or conflicting environments
This script is not a trading system and does not provide entries or exits. It is a contextual decision-support tool designed to improve alignment between price action and market risk conditions.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.