PSX Alpha
An AI-driven stock research engine for the Pakistan Stock Exchange. It scores and ranks every KSE-100 company from its published accounts, explains each pick in plain language, and tests the ranking against the index with a walk-forward backtest.
- Five scoring pillars — quality, value, safety, growth and momentum — each measured against sector peers
- Piotroski F-Score and Altman Z-Score, with separate rules for banks and insurers
- XGBoost ranker retrained every quarter on only the data available at the time, blended with the rule-based score
- Every explanation sentence is generated from a specific figure, so it always matches the score
- Screener, company pages, side-by-side comparison, watchlist and a full backtest view
- No look-ahead: a test plants a late restatement and checks it stays hidden until it is filed
- FastAPI endpoints for recommendations, companies, sectors, the backtest and custom screening
- 241 automated tests
Built with
- Machine learning
- XGBoost, scikit-learn, pandas
- Backend
- Python, FastAPI, SQLAlchemy, pytest
- Database
- PostgreSQL, SQLite
- Frontend
- Next.js, TypeScript, Tailwind CSS, Recharts