Predictors
Market intelligence for Indian equities — from raw NSE ticks to point-in-time predictors, ML return forecasts, and Lean backtests.
One pipeline, four layers
Kite Connect crawlers pull every NSE instrument and 25 years of daily candles into Postgres. Financial statements are processed into point-in-time metrics — a value for any month uses only data that was knowable then, with a configurable reporting lag. Predictor panels feed an ML pipeline that ranks stocks monthly; QuantConnect Lean turns those ranks into auditable backtests.
crawlers postgres compute serve
┌───────────┐ ┌──────────────┐ ┌───────────────┐ ┌──────────────┐
│ instruments│ │ instruments │ │ metric │ │ FastAPI │
│ historical │──▶│ daily_candles│──▶│ registry │──▶│ 1:1 REST │
│ (Kite API) │ │ company_info │ │ (@metric, │ │ + Python │
└───────────┘ │ financial_ │ │ dual-tag) │ │ library │
│ data │ │ panels/*.csv │ └──────┬───────┘
└──────────────┘ └───────┬───────┘ │
▼ ▼
ML pipeline dashboards /
(rank stocks) notebooks / Lean The predictor registry
Every predictor is a registered function carrying two tags: a standard financial category (for humans) and an ML feature-group alias (for models). Adding one predictor is one decorator — the panels, the API, and the registry pick it up automatically.
| ML group | Category | Predictors |
|---|---|---|
| momentum | momentum | mom1m · mom6m · mom12m · mom36m · chmom · indmom |
| valuation | value | bm · bm_ia · ep · sp · dp · dy · cashpr · rd_mve |
| profitability | profitability | operprof · ps |
| growth | investment | agr · invest · chinv · nincr |
| leverage | investment | lgr · chcsho |
| size | size | mvel1 |
One API, two access paths
All logic lives in a Python library. The REST layer is a thin
wrapper — every endpoint maps to exactly one library function,
with zero logic of its own. Point-in-time guarantees travel with
the call: asof_lag controls how
stale financial statements are allowed to be.
| Endpoint | Library function |
|---|---|
| GET /tickers | list_tickers(session, sector?, industry?) |
| GET /tickers/{code}/daily | get_daily_candles(session, code, start?, end?) |
| GET /tickers/{code}/metrics | get_metrics(session, code, metrics?, asof_lag?) |
| GET /panel/{metric} | get_panel(metric, start?, end?) |
| GET /metrics | list_metrics() |
Backtest results
Monthly stock ranking on 447 engineered features against the Fama-French 6-factor benchmark, evaluated in QuantConnect Lean.
| Model | Approach | Cum. return | Sharpe | Info. ratio |
|---|---|---|---|---|
| OLS-all L2 | Ridge on 447 features | 1.362 | 0.792 | 0.812 |
| OLS-all Huber+EN | ElasticNet-Huber, sparse | 1.154 | 0.724 | 0.130 |
| GBRF Huber | Gradient-boosted, robust loss | 1.210 | 0.757 | 0.303 |
| OLS-3 Huber | Fama-French baseline | 1.084 | 0.689 | -0.105 |
Best alpha vs FF6: +0.26%/month (OLS-all L2). Predictive R² reported per model in the full research report.
Built with
Python 3.13 · uv workspace · Postgres 16 · pandas · SQLAlchemy · FastAPI · scikit-learn · QuantConnect Lean · pytest
Talk to us about it