OPEN-SOURCE SCRIPT
Aktualisiert

VIX Regime Analyzer

118
VIX Regime Analyzer
The VIX Regime Analyzer is an analytical tool that examines historical VIX patterns to provide insights into how your asset typically performs under similar volatility conditions.

Key Features:
  • Historical Pattern Matching: Automatically scans up to 1,000 bars of history to find all periods when VIX was at levels similar to today, using customizable tolerance ranges (absolute or percentage-based).
  • Forward-Looking Statistics: For each VIX regime match, calculates what actually happened to your asset over the next 1, 5, 10, and 20 trading days, providing both average returns and probability of positive outcomes.
  • Regime Classification System: Intelligently categorizes the current market environment as bullish or bearish:
Visual Historical Context:
Background shading throughout your chart highlights every historical period when VIX matched current levels, color-coded by subsequent performance (green for gains, red for losses).

User Inputs:
  • VIX Level Tolerance (+/-): How closely VIX must match (default: ±5 points)
  • Use Relative Tolerance (%): Switch to percentage-based matching for consistency across different VIX levels
  • Lookback Period: How many bars to analyze
  • Highlight Historical VIX Matches: Toggle background highlighting of past matching periods
The Data Table
The statistics box appears in the right handside of your chart and contains three main sections:

Section 1: VIX REGIME
Current VIX: The live VIX closing price
Range: The tolerance band being searched (e.g., if VIX is 18 with ±5 tolerance, range is 13-23)
Historical Samples: Number of matching periods found in the lookback window (minimum 10 required for statistical validity)

Section 2: FORWARD RETURN
Shows the average percentage change in your asset over different timeframes following similar VIX levels:

Avg Next Day: What typically happened by the next trading session
Avg Next 5 Days: Average 5-day forward performance
Avg Next 10 Days: Average 10-day forward performance
Avg Next 20 Days: Average 20-day forward performance (approximately 1 month)

Section 3: PROBABILITY UP
Shows the win rate - the percentage of times your asset closed higher after VIX matched current levels:

Next Day: Probability of being up the next session
Next 5 Days: Probability of being up after 5 days
Next 10 Days: Probability of being up after 10 days
Next 20 Days: Probability of being up after 20 days

Colors:
🟢 Green: Bullish regimes (various strengths)
🔴 Red: Bearish regimes (various strengths)
🟡 Yellow: Choppy/uncertain regime

When "Highlight Historical VIX Matches" is enabled:
Scroll back through your chart and you'll see colored backgrounds highlighting every period when VIX matched today's level. The color tells you whether that match led to gains (green) or losses (red). This provides instant visual pattern recognition - you can quickly see if similar VIX levels historically led to bullish or bearish outcomes.
Practical Example:
If you see that most historical periods with similar VIX levels are highlighted in green, it suggests the current VIX level has historically been a bullish signal for your asset.
How The Indicator Makes Decisions
The regime classification uses both magnitude AND probability to avoid false signals:
Example of Strong Classification:

Average 5-day return: +1.5%
Win rate: 65%
Result: STRONG BULLISH (both high return and high probability)

Example of Weak Signal:
Average 5-day return: +2.0%
Win rate: 35%
Result: CHOPPY (high average but low consistency = unreliable)

This dual-factor approach ensures the indicator doesn't mislead you with regimes that had a few huge winners but mostly losers, or vice versa.

Best Practices
Combine with your existing strategy: Use this as a regime filter rather than standalone signals
Check sample size: More historical matches = more reliable statistics
Consider multiple timeframes: If 5-day and 20-day metrics disagree, proceed with caution
Asset-specific tuning: Different assets may require different tolerance settings
VIX spikes: The indicator is particularly useful during VIX spikes to understand if panic is justified

What Makes This Different
Unlike simple VIX indicators that just plot the fear index, this tool:
  • Quantifies the actual impact of VIX levels on YOUR specific asset
  • Provides probability-based forecasts rather than subjective interpretation
  • Shows historical context visually so you can see patterns at a glance
  • Uses rigorous statistical criteria to avoid false regime classifications
Versionshinweise
Fixed Box Height Issue

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.