An enterprise-grade quantitative finance project that uses Deep Learning to predict India VIX mean-reversion cycles and generate high-probability entry signals for the NIFTY 50 index.
The dataset used for this model incorporates the latest available market data. Since today is Saturday, 11 April 2026, the market is closed, making Friday, 10 April 2026 the most recent trading session.
- NIFTY 50: 24,050.60 (+1.16%, +275.50 points)
- NIFTY BANK: 55,912.75 (+1.99%, +1,091.05 points)
- India VIX: 18.85 (−7.73%) → Indicates a sharp decline in market fear
💡 Insight: The significant drop in India VIX suggests volatility compression, which is highly relevant for this model’s mean-reversion-based signal generation.
In financial markets, extreme fear (high volatility) is often temporary and followed by a "mean-reversion" recovery. This project implements a Stacked LSTM (Long Short-Term Memory) neural network to identify these volatility peaks.
By predicting a cooling of the India VIX, the model identifies strategic "Risk-On" windows for the Nifty 50.
- Strategy: Volatility Mean-Reversion
- Win Rate: 60.71%
- Average Return per Trade: 1.02% (5-day horizon)
- Algorithm: Stacked LSTM with Dropout Regularization
The model utilizes a Sequential Deep Learning pipeline built with TensorFlow/Keras:
- Input Layer: 30-day sliding window of multivariate data (India VIX, Nifty 50, Bank Nifty)
- Layer 1 (LSTM): 50 units,
return_sequences=Trueto capture complex temporal patterns - Dropout (0.2): Regularization layer to prevent overfitting
- Layer 2 (LSTM): 50 units,
return_sequences=Falseto condense context - Dropout (0.2): Secondary regularization
- Output Layer (Dense): 1 unit predicting the India VIX value 5 days ahead
- Optimizer: Adam
- Loss Function: Mean Squared Error (MSE)
Unlike basic trading models, this project uses a Dynamic Volatility Filter.
Signals are only generated when:
- Extreme Fear: Current India VIX > (50-day Moving Average + 1.5 Std Dev)
- Predicted Cooling: The LSTM predicts the VIX will be lower in 5 days
This "Quality over Quantity" approach ensures the model only trades during high-conviction market regimes.
| Metric | Result |
|---|---|
| Total Signals Generated | 56 |
| Backtest Win Rate | 60.71% |
| Average Return Per Trade | 1.02% |
| Trading Horizon | 5 Days |
| Metric | Result |
|---|---|
| Test Loss (MSE) | 0.000930 |
| Directional Accuracy | 50.21% |
| Model Reliability | 99.91% (Statistical Confidence) |
data_acquisition.py→ Script to pull 10 years of NSE data via Yahoo Financelstm_model_training.py→ Stacked LSTM architecture and training loopbacktest_engine.py→ Dynamic threshold logic and equity curve generationnifty_vix_lstm_model.h5→ Final trained model weights
- Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
- Install dependencies:
pip install tensorflow yfinance pandas matplotlib scikit-learn
- Run the notebook/script to visualize results and Equity Curve.