Opening-range breakout bot for NSE equities and index options against the Zerodha Kite Connect API — ORB + session VWAP + RSI gate, software-managed bracket orders, atomic state, crash reconciliation and hard risk limits (1% sizing, daily trade caps, −3% kill-switch, timed square-off). Paper-trading only; never traded real capital, no profit claims.
+4 lines (click to expand)
- 194-test suite, written test-first (TDD).
- Synthetic OCO brackets: the hard stop rests at the broker, the target is software-managed and cancels the stop first, so a fast market can never fill both sides.
- Every trade transition persisted atomically (temp → fsync → rename); restart replays the broker order book through idempotent handlers.
- Diagnosed a concurrency freeze — a cross-thread WebSocket close swallowed by the reactor thread — by reproducing it as a failing regression test, then rebuilt reconnect as an atomic reactor-thread callback with exponential backoff.