The Situation
Northstar Trading Desk is a solo proprietary trader running multiple equity and options strategies across two broker accounts. Strategy logic lived in a mix of Excel spreadsheets driven by add-in market data and Python Jupyter notebooks that the trader executed manually each morning. Order entry was a copy-paste exercise from notebook output into broker GUIs, and end-of-day reconciliation involved exporting fills from both brokers, importing into a spreadsheet, and hand-matching against intended trades. There was no central event store, no audit trail, and no way to run a strategy in shadow mode against live data without committing capital. As the trader added strategies, the manual workflow began to drop trades and miscount positions.
The Challenge
The platform had to handle four overlapping problems: a bot orchestrator that could run multiple Python strategies in parallel against live market data and route orders to two different brokers, a Postgres event store recording every signal, intended order, broker acknowledgment, and fill in a single auditable timeline, a backtest harness that could replay the same strategy code against historical Polygon data without bespoke rewrites, and hard risk caps — per-strategy notional limits, per-account daily-loss circuit breakers, and a global kill switch — wired into the order path itself rather than the UI.
Our Approach
QuantLab designed the system as a Python 3.12 orchestrator running each strategy in its own asyncio task, with a thin abstraction layer over both broker WebSocket APIs so the same strategy code could target either account. Every event — market data tick consumed, signal generated, order intended, order acknowledged, fill received — was persisted to a Postgres event store with strict ordering. The backtest harness reuses the live orchestrator code paths by swapping a historical-data source in place of the WebSocket feed, so a passing backtest gives the trader real confidence the same code will behave the same way live. The Next.js dashboard reads the event store directly and renders position, P&L, and risk-cap state in real time.
What We Built
- Python 3.12 bot orchestrator running multiple strategies in parallel async tasks
- Postgres event store persisting every signal, order intent, acknowledgment, and fill with strict ordering
- Backtest engine reusing live orchestrator code against historical Polygon data
- Real-time Next.js risk dashboard showing positions, P&L, and per-strategy cap utilization
- Polygon.io market data feed with reconnection and gap-fill handling
- WebSocket adapters for two broker APIs with hard risk caps wired into the order path
Tech Stack
The Outcome
The trader had four strategies in live production within the nine-week build window, up from two manually executed strategies pre-engagement. Manual reconciliation dropped by over eighty percent because every fill was already in the event store matched to its originating signal. Risk caps and the kill switch caught two would-be incidents in the first month — one runaway position from a parameter typo, one broker connection issue that auto-flattened positions. Order placement latency from signal to broker acknowledgment now sits consistently under fifty milliseconds.
Like to know more about this project? Talk to William.
Related Services