Views
No views yet
| Version | Description | Sharpe | Bear Sharpe | Max DD |
|---|---|---|---|---|
| v5 (Bear-Corrected) | Regime-aware, works in both bull & bear | 0.428 | -3.515 | -48.5 bps |
| v3 (Bull-Biased) | Original LSTM, bull-market optimized | 1.619 | -4.141 | -26.1 bps |
| Always Short Vol | Baseline: constant short straddle | 0.750 | -4.141 | -55.2 bps |
| Strategy | Sharpe | Ann. Return (bps) | Max DD (bps) | Win Rate | Bear Sharpe |
|---|---|---|---|---|---|
| LSTM v5 (Bear-Aware) | 0.428 | 11.2 | -48.5 | 73.7% | -3.515 |
| Always Short Vol | 0.750 | 23.6 | -55.2 | 77.0% | -4.141 |
| GBM | -4.329 | -95.7 | -230.1 | 34.6% | -3.657 |
| HAR-RV | -1.953 | -26.7 | -81.8 | 50.7% | -7.240 |
| VRP Rules | -5.329 | -106.5 | -251.9 | 28.0% | -5.683 |
Input (57 features × 22 timesteps)
↓
LSTM (2 layers, 96 hidden, dropout=0.25)
↓
Self-Attention (temporal weighting)
↓
BatchNorm
↓
┌─────────────────────┬──────────────────┬────────────────────┬──────────────────┐
│ P&L Prediction │ Spike Detection │ Profit Classifier │ Bear Regime │
│ (regression) │ (binary) │ (binary) │ (binary) [NEW] │
│ → position sizing │ → risk mgmt │ → entry signal │ → regime aware │
└─────────────────────┴──────────────────┴────────────────────┴──────────────────┘1# LSTM outputs 4 signals:
2profit_prob = model.profit_head(context)
3spike_prob = model.spike_head(context)
4bear_prob = model.regime_head(context) # NEW
5
6# Step 1: Base signal (same as v3)
7base = (profit_prob - 0.28) * 2.5
8
9# Step 2: Spike protection (same as v3)
10if spike_prob > 0.5: base *= (1.0 - spike_prob)
11if spike_prob > 0.7: base = min(base, -0.2)
12
13# Step 3: Bear regime reduction (NEW - gradual)
14if bear_prob > 0.7:
15 bear_scale = max(0.1, 1.0 - (bear_prob - 0.7) * 3.0)
16 base *= bear_scale
17
18# Step 4: Multi-confirmation long vol (NEW - strict)
19if bear_prob > 0.8 and spike > 0.6 and drawdown < -0.10 and VRP < -0.005:
20 base = min(base, -0.3) # go long vol
21
22# Step 5: Deep drawdown circuit breaker (NEW)
23if drawdown < -0.15 and VRP < -0.01:
24 base = min(base, 0.0) # flatten
25
26position = clip(base, -0.5, 1.5)| Category | Features |
|---|---|
| HAR-RV | rv_5, rv_10, rv_22, rv_44, rv_63, rv_126 |
| Vol Estimators | Garman-Klass, Parkinson |
| India VIX | Level, returns, MAs (5/10/22/44), z-scores, percentiles |
| VRP | IV²-RV², VRP ratio, z-score, percentile |
| Momentum | 1d, 5d, 10d, 22d, 63d returns |
| Higher Moments | 22d realized skew, kurtosis |
| Vol of Vol | RV vol-of-vol, VIX vol-of-vol |
| Cross-Market | CBOE VIX, India-US VIX spread |
| Calendar | Day-of-week, month (sin/cos encoded) |
| 🐻 Drawdown | Drawdown from peak, 5d smoothed drawdown |
| 🐻 Trend | Death cross (SMA50/200), risk-adj trend 22d/63d |
| 🐻 Regime | Down streak %, VRP neg fraction 22d/63d, bear composite score |
| 🐻 Vol Dynamics | RV acceleration, RV accel z-score |
| 🐻 VIX Dynamics | VIX velocity 5d/10d, tail risk 22d, VIX skew 22d |
^NSEI — Nifty 50 Index (OHLCV, 2009-present)^INDIAVIX — India VIX (2009-present)^VIX — CBOE VIX (cross-market feature)1import torch
2from sklearn.preprocessing import RobustScaler
3
4# Load v5 model
5checkpoint = torch.load('nifty_vol_model_v5_bear.pt')
6model = BearAwareLSTM(**checkpoint['config'])
7model.load_state_dict(checkpoint['model_state_dict'])
8model.eval()
9
10# See nifty_vol_trading_v5_bear.py for full pipelinenifty_vol_model_v5_bear.pt — v5 trained PyTorch model checkpointnifty_vol_trading_v5_bear.py — v5 complete training + backtest pipelinebacktest_results_v5.csv — v5 backtest resultsbacktest_results_v5.png — v5 comprehensive visualizationrecent_performance_v5.png — v5 recent 6-month detailday_by_day_backtest_v5.png — v5 vs always-short comparisonmetrics_v5.json — v5 metrics (includes Bear Sharpe)nifty_vol_model_final.pt — v3 trained modelnifty_vol_trading_v3.py — v3 training pipelinebacktest_results.csv / backtest_results.png — v3 resultsmetrics.json — v3 metrics