Blog · APIs
Building a trading application: the six things that break in production
A strategy that works in a backtest meets six new enemies the moment it goes live. Here is the roadmap from idea to production, and the failures to design out first.
The backtest is the easy part. It runs on clean historical data, in a world where every order fills and nothing disconnects. Production is a different environment, and algo trading in India adds its own rules on top. This is the roadmap we use when we build trading applications, and the six failures we design out before anything touches real money.
The roadmap: six stages, in order
The data stage deserves more time than it usually gets. A backtest is only as honest as its history: resolution, adjustment and depth all change the answer, as we showed in which data to backtest on.
The six things that break in production
| # | Failure | Why the backtest never saw it | Design it out with |
|---|---|---|---|
| 1 | Data gaps on reconnect | History has no disconnections | Automatic backfill; alert on missing ticks |
| 2 | Order state drift | Every order “fills” instantly | Reconcile with the broker every few seconds; trust their state, not yours |
| 3 | Opening-bell rate limits | No API limits in a simulator | Queue and throttle; stagger subscriptions |
| 4 | Partial fills and slippage | Fills at the bar price | Model slippage by liquidity; handle partials explicitly |
| 5 | Clock and session edges | Bars are already aligned | Exchange timestamps only; session-aware logic |
| 6 | Silent failure | You watch every run | Heartbeats, kill switch, daily loss limit, alerts to a phone |
The first failure is the one we see most. A live stream will disconnect; the only question is whether your system notices. A feed that backfills gaps automatically, like the one behind Pix APIs and Pix Connect, removes a whole class of bugs before you write any code.
The rules: SEBI’s retail algo framework
In February 2025 SEBI issued a framework for the safer participation of retail investors in algorithmic trading, implemented by exchanges and brokers in phases since. In outline:
- Brokers are responsible for algos that run through their APIs, and algo orders carry an identifier so the exchange can trace them.
- Higher-frequency algos above an order-rate threshold must be registered with the exchange through the broker.
- API access is controlled, for example through static IP whitelisting and stronger authentication.
- White-box and black-box algos are distinguished; black-box providers carry additional obligations, including research analyst registration.
Build, or have it built
A solo developer can build a reliable single-strategy system. A multi-strategy platform, a broker-facing product or anything with client money needs the engineering discipline above as a baseline. Accel Fintech, our engineering arm, builds trading applications, algo platforms and broker integrations on the same feed our products use — talk to the development team if you would rather start from a working foundation. For discretionary analysis alongside your algos, TradeX puts the option chain, OI and Greeks in a browser tab.
The pre-live checklist
Before any strategy trades real capital, every item below should be a yes. We treat this as a gate, not a guideline.
| Area | Check |
|---|---|
| Data | Gap backfill tested by pulling the network during market hours |
| Data | Symbol master refreshed daily; expiries and lot sizes never hard-coded |
| Orders | Reconciliation with the broker proven after a forced restart mid-session |
| Orders | Partial fills, rejections and modifications all handled and logged |
| Risk | Daily loss limit, per-trade size cap and a manual kill switch that works from a phone |
| Risk | Position sizing tied to account equity, not fixed quantities |
| Compliance | Algo registered or tagged as your broker requires; static IP configured |
| Operations | Heartbeat alerts if the strategy, the feed or the broker link goes quiet |
Monitoring that actually catches problems
Logging everything is not monitoring. The signals worth alerting on are few and specific:
- Silence. No ticks for a liquid symbol for more than a few seconds during market hours.
- Divergence. Your position and the broker’s position disagree.
- Drift. Live slippage consistently worse than the backtest assumed — the strategy may be too slow for its market.
- Behaviour. Trade count or holding time far outside the backtest’s range, which usually means a bug, not a new regime.
For position sizing that ties risk to capital, the free position size and risk-reward calculators are a fast sanity check before you encode the rules.
- Paper-trade on live data before any real capital; that is where most failures surface.
- Design out the six production failures explicitly — none of them appear in a backtest.
- Reconcile order state with your broker; never trust your own copy.
- Know the SEBI retail algo framework and your broker’s implementation before you build.
Source: SEBI, “Safer participation of retail investors in Algorithmic trading”, circular dated February 2025, and exchange implementation standards issued thereafter.
Questions traders ask
Is algo trading legal for retail traders in India?
Yes. SEBI’s 2025 framework allows retail algorithmic trading through brokers, with algo orders tagged and higher-frequency algos registered with the exchange through the broker. Check your broker’s current implementation.
What is the difference between white-box and black-box algos?
A white-box algo discloses its logic to the user. A black-box algo does not, and under the SEBI framework its provider carries additional obligations, including research analyst registration.
What breaks most often when an algo goes live?
Data gaps and reconnections, order state getting out of sync with the broker, and rate limits during the opening minutes. All three are invisible in a backtest.
Test it on your own symbols
Five days of full realtime and historical access, on your platform or through the API. No card, no auto-charge.
Start your 5-day free trial