This project implements a statistically driven pairs trading strategy for Indian equities using cointegration and mean reversion.
- Pair selection via correlation + Engle Granger cointegration
- Structural filtering using half life of mean reversion
- Z-score calibration on 2020–2024 daily data
- Out of sample simulation on 2025 data
- Capital aware execution with stop loss and cooldown rules
- data/raw: input datasets
- data/generated: reproducible outputs
- src: full research and execution pipeline
-
Pair Selection (2020–2024)
- Same sector filtering out of Nifty 100
- Correlation screening
- Engle Granger cointegration
- Hedge ratio estimation
-
Structural Validation
- Mean reversion half life estimation
- Spread stability checks
-
z-Score Calibration
- Rolling z-score using daily data
- Entry / Exit threshold optimization
- Drawdown-aware scoring
-
Trading Engine (2025 Simulation)
- Daily execution
- Symmetric entry / exit / stop logic
- Integer share sizing (Indian market compliant)
- INR PnL accounting
- Cooldown after stop loss
-
Interactive Dashboard
- Capital adjustable PnL
- Pair wise trade breakdown
- Cumulative performance visualization
python src/Ppair_selector.py
python src/Pair_analysis 20-24.py
python src/z_backtest.py
python src/Engine_1d.py
streamlit run src/dashboard.py