Built an open-source paper-trading broker for NSE/BSE (Python) — realistic fees, T+1, order book. Looking for feedback.

I kept hitting the same wall building trading systems here: no proper paper-trading API for Indian markets. US has Alpaca; we have nothing you can actually build against. So I built one and open-sourced it (MIT).

pip install PaperTrade-India

What it models (the stuff that makes paper results meaningful):

  • Full fee stack — STT, exchange, GST, SEBI, stamp duty, DP — reconciled to a real contract note
  • T+1 settlement with deliverable-qty enforcement + intraday (MIS)
  • Tick / lot / SEBI price-band rules; market, limit, stop, bracket orders
  • Synthetic L2 order book that uses real 5-level depth when available
  • Slippage, latency, random-rejection simulation
  • Pluggable data providers (Upstox/Dhan live feeds → yfinance fallback, circuit breakers) + live holiday calendar
  • Alpaca-style Python API, SQLite persistence, multi-account, idempotency

Paper-only, not investment advice — it's for building and testing strategies without real capital.

v0.1, 600+ tests, MIT. Genuinely want feedback — especially the fee math and what's missing. Shorting is the top thing I'm weighing next. What would you need for it to be useful?

GitHub: https://github.com/Mirzabaig313/PaperTrade-India

u/EqualComplaint5259 — 1 month ago