- 13 algorithms
- 2,600+ stocks per run
- -91% backtest memory
- fails loudly, never guesses
A modular equity-analysis and portfolio engine for Indian markets, with a CLI, an API and a dashboard.
- Why
- Scattered fundamentals, technicals and sentiment are hard to compare. One pipeline makes the reasoning repeatable and testable.
- How
- Async ingestion with TTL caching and incremental refresh feeds a relational store. A registry of pluggable algorithms scores each stock, and a risk/return-aware optimizer builds the portfolio.
- Result
- 13 registered algorithms scoring 2,600+ NSE stocks in a full run, backtesting and walk-forward calibration, and a React dashboard on top.
Under the hood
01Async ingestion02TTL cache + incremental refresh03Relational store04Scoring engine05Portfolio optimizer06Backtest + calibration07CLI · API · dashboard
Key decisions
- Why PostgreSQL only? Backtesting, run history and analysis snapshots are relational and need transactions and migrations. Running one database everywhere removes a whole class of local-versus-production differences.
- Why async ingestion? The pipeline is I/O bound. Concurrent fetching with caching turns a slow serial crawl into something that can run daily.
- Why a plugin registry for algorithms? Each algorithm is one file behind one interface and is registered by decorator. Adding or retiring one never touches the rest, and the docs are checked against the registry so they cannot drift.
Trade-offs
- Operational simplicity (one database, one machine) over horizontal scale.
- Measurability over cleverness: every algorithm must be scoreable against history.
- A small, explicit public surface rather than exposing engine internals.
PythonFastAPIasynciohttpxPostgreSQLAlembicDockerReact