A sophisticated quantitative tool for monitoring asset correlations and identifying Statistical Arbitrage (Stat-Arb) opportunities using Cointegration and Z-Score analysis.
- Diversification Scoring: Institutional-grade metric to measure portfolio health based on average pairwise correlations.
- Relationship Mapping: Interactive Pearson Correlation heatmaps and rolling correlation dynamics.
- Stat-Arb Engine: Automated search for the most cointegrated asset pairs using Augmented Dickey-Fuller (ADF) testing.
- Z-Score Signals: Real-time spread tracking with standard deviation bounds for mean-reversion entries and exits.
- Crisis Stress Test: One-click simulation of the 2020 COVID-19 crash to analyze correlation breakdowns.
- Clone the repository:
git clone [https://github.com/pinxinfang/MeanReversionTester.git](https://github.com/pinxinfang/MeanReversionTester.git) cd MeanReversionTester - Install dependencies:
pip install streamlit pandas yfinance plotly statsmodels numpy
- Run the app:
streamlit run Correlation.py
This dashboard identifies pairs that exhibit Cointegration, meaning they share a long-term equilibrium. When the Z-Score of the spread deviates significantly (e.g., > 2.0 or < -2.0), it suggests a high-probability mean-reversion trade where the assets are likely to converge again.
Disclaimer: This project is for research purposes only. Trading involves significant risk.