๐ค๏ธ Today's Market Snapshot
30-second overview โ key indicators investors watch + regime interpretation
โ๏ธ
Low Risk โ Markets in Normal Mode
Low VIX + Trending Bull regime โ standard investment strategies remain viable
๐ญ
Market Regime
๐ Trending Bull
Uptrend โ SMA-50 > SMA-200 and low volatility
๐
S&P 500
7,520
+4.32% (20 day)
๐ก๏ธ VIX โ The Market Fear Index
CBOE Volatility Index โ derived from S&P 500 option implied volatility, 30-day horizon
- VIX < 15 = very calm (possibly complacent)
- VIX 15-20 = normal bull market range
- VIX 20-30 = investors getting nervous
- VIX 30-40 = crisis signal (2018 rate hikes, 2022 inflation)
- VIX > 40 = full crisis โ all-time peak: 82.69 (Mar 16, 2020 COVID)
๐ฌ
๐ก How to read: Blue line = actual VIX ยท Dotted orange = 20-day moving average ยท Red star = XGBoost's prediction for VIX 7 trading days from now
๐ VIX history + AI forecast (7-day ahead)
๐ก How to read: Blue line = actual VIX ยท Dotted orange = 20-day moving average ยท Red star = XGBoost's prediction for VIX 7 trading days from now
๐ฎ ML Forecast: 7-Day VIX Prediction
XGBoost trained on VIX lag features + macro indicators (yield curve, gold, oil, DXY) โ but check accuracy in the next section before trusting
๐
Forecast: VIX rising
Model expects VIX at 18.8 (delta +2.1 from today) โ heightened risk monitoring advised
๐ฌ
Important caveat: VIX is notoriously difficult to forecast โ even academic papers regularly report Rยฒ near zero. Treat this as a directional signal, not a precise number. See accuracy section below for the honest assessment.
๐ฏ But... How Accurate Is It?
Evaluated with walk-forward cross-validation (TimeSeriesSplit) โ the gold standard for time-series ML that prevents look-ahead bias
- Rยฒ (R-squared) = how much better the model explains variance vs predicting the mean
- Rยฒ = 1.0 = perfect prediction (never happens in practice)
- Rยฒ = 0 = same as predicting the mean โ useless
- Rยฒ negative = worse than predicting the mean โ model is harmful
๐ฌ
Model cannot beat the mean prediction โ consistent with the Random Walk Hypothesis (Fama, Nobel 2013). Markets contain enough randomness that ML often underperforms simple baselines on volatility forecasting.
โ๏ธ Model Comparison
Tested 4 ML models + 1 Naive baseline with walk-forward CV โ who wins at VIX forecasting?
- ๐ถ Naive baseline: persistence model โ predicts "VIX in 7d = VIX today" (no ML)
- ๐ฒ XGBoost: gradient-boosted trees, regularized (max_depth=3, n_estimators=100)
- ๐ก LightGBM: fast tree-based with leaf-wise growth
- ๐ Ridge: linear regression with L2 regularization
- ๐ง LSTM: 1-layer PyTorch LSTM (32 hidden units, dropout 0.2)
๐ฅ
Naive
Rยฒ = 0.101
Highest Rยฒ in this evaluation
๐ฅ
LSTM
Rยฒ = -3.744
Lowest Rยฒ in this round
๐ฌ
Surprise! Naive baseline beats every ML model
The "VIX in 7d = VIX today" model (Rยฒ = 0.101) beats XGBoost, LightGBM, Ridge, and LSTM. This is the Random Walk Hypothesis in finance โ asset prices move stochastically, making short-term prediction extremely difficult.
Engineering lesson: Always test naive baselines first. If your ML doesn't beat persistence, don't deploy it.
๐ SHAP: What Drives Model Decisions?
SHAP (SHapley Additive exPlanations) uses game theory to attribute predictions to features โ the gold standard for interpretable AI
- ๐ฏ SHAP values derived from Shapley values (Nobel Economics 1953)
- ๐ Shows each feature's marginal contribution to a prediction
- โ
Fair & consistent โ superior to XGBoost's built-in feature_importance
- ๐ Useful for debugging model behavior
๐ฌ
Model relies most heavily on SP500_Vol_20D โ this is the dominant signal driving predictions
๐ฌ Animated Timeline
Click โถ๏ธ Play to watch VIX evolve month-by-month over 5 years โ every crisis is visible (COVID, Russia-Ukraine war, 2022 inflation)
๐ฌ
Notice how VIX spikes during every black swan event: Feb 2020 (COVID), Feb 2022 (Russia war), Sep 2022 (Fed rate hikes). This is the recurring pattern we try to detect.
๐ 3D Visualization
3D scatter: time ร S&P daily return ร VIX โ drag with mouse to rotate ยท scroll to zoom
๐ฌ
Observable cluster: red points (high VIX) tend to coincide with days when S&P fell > 3% โ confirming the well-known negative correlation between VIX and S&P returns (typically -0.7 to -0.8).
๐ฐ Backtest: Is the Strategy Profitable?
Historical simulation over 5 years โ start with $1M, compare "Black Swan Strategy" vs "Buy & Hold" (including 10 bps transaction costs)
๐ก๏ธ
Black Swan Strategy
1,664,907
Initial $1,000,000 โ +66.5%
Max Drawdown: -28.0%
๐
Buy & Hold (baseline)
1,788,811
Initial $1,000,000 โ +78.9%
Max Drawdown: -25.4%
๐ฐ Includes 20 trades with 10 bps cost per turnover โ realistic conditions
๐ Equity Curve Comparison
๐ Which strategy has shallower drawdown?
Less depth = less pain. A good strategy should have shallower drawdown than the benchmark.
๐จ When did signals fire?
Red triangle markers = days the rule-based detector flagged risk
๐ฌ
โ Strategy underperforms Buy & Hold in this window โ because the past 5 years were a bull market, defensive systems sacrifice upside by sitting in cash during rallies.
The strategy's value emerges during actual crises like COVID-2020 or 2008.
๐งช Paired t-test: Is the strategy significantly better than baseline?
Hypothesis test โ Hโ: mean(strategy โ baseline) โค 0 vs Hโ: mean(strategy โ baseline) > 0 (one-sided) at ฮฑ = 0.05
p-value (one-sided)
0.7097
โ ๏ธ Fail to reject Hโ โ insufficient evidence that strategy beats baseline (p โฅ ฮฑ). Consistent with the Random Walk Hypothesis.
๐ Multi-Asset Volatility
Realized volatility across asset classes: US equity, crypto, gold, emerging markets โ if all assets spike together = systemic crisis
๐ฌ
Bitcoin's realized volatility is typically 3-5ร higher than S&P 500. Gold acts as a "safe haven" โ often uncorrelated or negatively correlated with equities during crises.
If all assets spike together = systemic risk signal (e.g., COVID-2020, when even gold fell briefly).
๐ Bottom Line
๐ก๏ธ Today's market
โ๏ธ Trending Bull ยท VIX = 16.71
๐ฎ 7-day forecast
โ ๏ธ VIX expected to rise to 18.8 (+2.1)
๐ก What this system does
An early-warning system for market regime changes. Combines 3 signals: news sentiment (FinBERT) + ML forecast + rule-based crisis detector. It does NOT predict the future with certainty โ but it helps reduce drawdowns during crises.
โ ๏ธ Disclaimer
This is an educational and research project โ not financial advice. Past performance does not guarantee future results. Markets can stay irrational longer than you can stay solvent.
For engineers / data scientists
๐ Technical Numbers
- VIX: 16.71
- AI Forecast (7d, XGBoost): 18.82
- Walk-Forward Mean Rยฒ: -0.094 ยฑ 0.571 (5 folds)
- Best Model (regression): Naive
- Backtest Sharpe: Strategy 0.74 vs B&H 0.77
- Max Drawdown: Strategy -28.02% vs B&H -25.43%
- Transaction cost: 10 bps per turnover
- Features: 13 (VIX lags, S&P returns, yield curve, gold/oil/DXY)
๐ Methodology
- Time-series validation: TimeSeriesSplit, no shuffle (no look-ahead bias)
- FinBERT (ProsusAI) for news sentiment (separate Streamlit app)
- SHAP TreeExplainer for feature attribution
- Multi-asset volatility: realized vol 20d annualized (proxy for non-VIX assets)
- Regime: SMA-50/200 crossover + 20d rolling vol vs historical median
Full source code:
github.com/oomNoNe/black-swan-indicator