A dashboard for pair trading strategy system 📈📊 — visualize, analyze, and manage statistically paired assets.
A complete end-to-end dashboard built with a frontend UI and backend logic to support pairs trading strategies in financial markets.
QuantPair is an interactive Pairs Trading Dashboard that helps you:
✔ Explore statistical relationships between asset pairs
✔ Generate trading signals using classic quantitative finance techniques
✔ Track performance and visualize entry/exit opportunities
A perfect tool for traders, quants, and data-driven investors!
| Feature | Description |
|---|---|
| 📊 Interactive Dashboard | Frontend UI to visualize price spreads and signals |
| 📈 Pairs Strategy Logic | Compute co-integration and trading signals |
| 🔄 Backend API | Serve data and analytics securely |
| 🧪 Strategy Testing | Test historic data to validate signals |
| 📁 Modular Architecture | Separate frontend and backend projects |
| Layer | Technology |
|---|---|
| Frontend | JavaScript / React |
| Backend | Python (FastAPI / Flask / Pandas / Numpy / Yfinance) |
| Visualization | Chart.js |
| Deployment | Vercel / Render/ Cloud Hosting |
QuantPair/
├── backend/
├── api.py
├── backtest.py
├── data_acquisition.py
├── hedge_ratio.py
├── pair_selection.py
├── risk_management.py
├── run.py
├── spread_signal.py
├── trading_rules.py
├── visualization_data.py
├── visualization.py
└── requirements.txt
├── frontend/quantpair/
├── public/
├── src/
├── pages/
├── api/
└── components/
└── index.html
└── README.md
git clone https://github.com/Arijit2175/QuantPair.git
cd QuantPair
cd backend
pip install -r requirements.txt
cd frontend/quantpair
npm install
A quick look at the QuantPair Dashboard and its features 📊🚀
| Feature | Preview |
|---|---|
| 📈 Pair Price Chart | ![]() |
| 📊 Spread & Z-Score | ![]() |
| Asset A | Asset B | Z-Score | Signal |
|---|---|---|---|
| KO | PEP | 1.57 | 📉 Sell KO / 📈 Buy PEP |
- 🥤 KO (Coca-Cola) is overpriced relative to PEP
- 🥤 PEP (Pepsi) is underpriced relative to KO
- 📊 Z-score of 1.57 indicates a divergence from the mean
- ⚡ Strategy suggests:
- Short (Sell) KO
- Long (Buy) PEP
QuantPair evaluates multiple statistical and trading metrics to identify strong asset pairs and generate reliable trading signals.
What it is:
The difference between the prices of two assets.
How it is calculated: Spread = Price(A) − Price(B)
Purpose:
Helps measure how far apart two related assets have moved from each other.
What it is:
A normalized value indicating how far the current spread deviates from its historical mean.
How it is calculated: Z-score = (Spread − Mean Spread) / Standard Deviation
Purpose:
- Identifies overvaluation and undervaluation
- Used to generate buy/sell signals
- Higher absolute value ⇒ stronger divergence
What it is:
A statistical test that checks if two assets move together in the long run.
How it is evaluated:
- Uses historical price series
- Applies cointegration test (e.g., Engle-Granger)
Purpose:
Ensures only statistically related pairs are traded
Reduces false signals
What it is:
Measures short-term linear relationship between two assets.
How it is calculated: Correlation = cov(A, B) / (std(A) × std(B))
Purpose:
- Filters weakly related asset pairs
- Confirms similarity in price movement
What it is:
Final action recommendation based on Z-score thresholds.
How it is generated:
| Z-Score Range | Signal |
|---|---|
| Z > +Threshold | 📉 Sell Asset A / 📈 Buy Asset B |
| Z < -Threshold | 📈 Buy Asset A / 📉 Sell Asset B |
| Between limits | ⏸️ Hold |
| Metric | Purpose |
|---|---|
| 📈 Total Return | Measures profit from strategy |
| 📉 Max Drawdown | Measures worst loss |
| 📊 Sharpe Ratio | Risk-adjusted return |
| 🔁 Win Rate | Percentage of profitable trades |
These metrics help ensure:
- 📉 Mean reversion behavior
- 📊 Statistical validity
- ⚡ Actionable trading signals
- 🧠 Data-driven decisions
All calculations are based on historical price data and updated dynamically within the dashboard.
QuantPair is already deployed and accessible online 🎉
🔗 Live Application:
👉 https://quant-pair.vercel.app/
- J. Sen, “Designing Efficient Pair-Trading Strategies Using Cointegration for the Indian Stock Market,” IEEE International Conference ASIANCON'22, Pune, India, 2022.
- X. Law, W. Li & P. Yu, “A single-stage approach for cointegration-based pairs trading,” Finance Research Letters, vol. 26, pp. 177–184, 2018.
- Y. Ti, T. Dai, K. Wang, et al., “Improving Cointegration-Based Pairs Trading Strategy with Asymptotic Analyses and Convergence Rate Filters,” Computational Economics, vol. 64, pp. 2717–2745, Jan. 2024.
- M. Clegg & C. Krauss, “Pairs trading with partial cointegration,” Quantitative Finance, vol. 18(1), pp. 121–138, 2017.
- H. Xing, “A singular stochastic control approach for optimal pairs trading with proportional transaction costs,” arXiv, Nov. 2019.
- G. Zhang, “Pairs Trading with Nonlinear and Non-Gaussian State Space Models,” arXiv, May 2020.
- Masood Tadi & Irina Kortchemski, “Evaluation of dynamic cointegration-based pairs trading strategy in the cryptocurrency market,” Studies in Economics and Finance, vol. 38, no. 5, 2021.
- “Cointegration-based pairs trading: identifying and exploiting similar exchange-traded funds,” Journal of Asset Management, Springer, 2025.
- C. Ungever, “Pairs Trading to the Commodities Futures Market Using Cointegration Method,” International Journal of Commerce and Finance, vol. 1, no. 1, 2015.
👨💻 Developed by – @Arijit2175

