Three ways to build one
| Route | How it works | What you take on |
|---|---|---|
| Code it yourself | Write Python (or any language) against your broker’s API — Kite Connect, DhanHQ, SmartAPI or the Groww Trade API. | Everything: daily sign-in, the static IP, the instrument master, streaming reconnects, candle building, order reconciliation, rate limits, backtest parity and monitoring. |
| A cloud algo platform | Configure a strategy in a browser; it runs on the provider’s servers against your broker account. | A monthly fee, and your strategy and broker session living on someone else’s servers. Check that the provider is empanelled with the exchanges. |
| QuantumCat bots | Build rules in the five-step guided builder, or ask JARVIS to build them; they run inside the terminal on your own machine, through your own broker API key. | The app must be running for the bot to trade. Where your broker supports standing triggers, broker-side stops keep protecting positions if it closes. |
The rules you trade under
SEBI’s framework for safer participation of retail investors in algorithmic trading (circular of 4 February 2025) was phased in through 2025 and applies in full from 1 April 2026 (SEBI timeline). What it means for a retail trader automating through a broker API:
- API orders must come from a static IP registered with your broker. Charts and market data are not gated; order placement is.
- Every algorithmic order carries an exchange-issued identifier, so the exchange can trace it to the strategy that sent it.
- A self-built strategy below the exchanges' threshold of 10 orders per second needs no separate registration; above it, the strategy must be registered with the exchange through your broker (NSE circular).
- Brokers control API access. They issue the API keys, and third-party algo providers must be empanelled with the exchanges through a broker.
QuantumCat bots place orders through your broker’s official API, under your own credentials and your broker’s rate limits, from the IP you registered with your broker. Depending on your broker and your strategy, exchange algo rules may apply to you — read your broker’s API terms before you run a bot live; compliance with them is yours.
Where home-made bots lose real money
Most bot losses have nothing to do with the strategy. They come from execution details a backtest never sees. Here is what to guard against, and how QuantumCat handles each one.
| Failure | What goes wrong | How QuantumCat handles it |
|---|---|---|
| Forming-candle signals | An indicator crosses mid-bar, the bot enters, and by the close the signal is gone. | Entries evaluate only on the just-closed bar, at the bar boundary. |
| Level, not edge | A condition that is already true at the open fires the moment the market gaps. | Rising-edge entries: a condition must become true while the bot watches, and the edge re-primes each session. |
| Warm-up values | An indicator without enough history returns a number anyway, and the bot trades on it. | Three-valued logic: a warming or missing value is UNKNOWN — it never fires an entry and never satisfies a NOT. |
| Duplicate orders | A timeout looks like a failure, the bot retries, and two orders land. | An unconfirmed order is reconciled against the broker’s book before anything retries; a placed-but-unconfirmed order is never placed twice. |
| Half-filled structures | One leg of a spread fills and the hedge doesn’t — a defined-risk trade becomes a naked short. | Hedge-first sequencing and unwind-on-partial for multi-leg option structures. |
| Expired sessions | The broker token lapses overnight and the bot is silently offline at 9:15. | Automated daily sign-in where the broker allows it, with session health and token expiry shown per broker. |
| Stale data | The feed freezes and the bot keeps managing positions on old prices. | A stale feed with an unprotected position triggers a protective flatten; a wrong-broker feed pauses evaluation entirely. |
| Backtest ≠ live | The simulation decides at different times, on different logic, than the live bot. | One condition tree gives the same verdict in the bot, the screener and the backtester; daily-class bots wake at 09:16, exactly when the backtester says they do. |
Build your first bot in QuantumCat
- Connect your broker. Add your Zerodha, Dhan, Angel One or Groww API key once — it goes into an encrypted vault on your own machine — and register your IP for orders. The setup guide takes a few minutes.
- Create a bot. Choose what it trades and the candle timeframe it decides on.
- Write the entry. Combine indicators, price fields, option-chain metrics, Pulse states and time windows with AND, OR and NOT in the guided builder — or describe the idea to JARVIS and review the rules it builds.
- Add exits and risk rails. Stop-loss, target and trail in points, percent, ATR or R-multiples; a daily loss cap; maximum trades and re-entries with cooldowns; a time exit that flattens at your cutoff.
- Backtest it. Every simulated trade pays estimated Indian charges and fills at the next bar’s open. If the result depends on data the simulator cannot reproduce, it refuses and tells you why.
- Run it on paper. Paper mode is the default. Watch it through a few sessions and open the X-ray to see every condition’s live value and which gate — schedule, regime, cap or cooldown — is holding it.
- Go live small. Switch to live with small size, keep broker-side stops armed where your broker supports them, and keep the kill switch — one control that stops every bot, cancels working orders and flattens every position — within reach.
Coding it yourself? Here is the real checklist
If you would rather write your own bot, budget for much more than the strategy. A dependable bot on an Indian broker API needs:
- A daily sign-in routine for tokens that expire every trading day, and handling for broker outages that look like bad credentials.
- The broker’s instrument master, refreshed daily, with exchange-qualified identifiers and correct lot sizes, tick sizes and freeze quantities.
- A streaming client that reconnects, resubscribes and detects a stale feed — and a candle builder that never trades a forming bar.
- An order state machine that reconciles against the broker’s book after every timeout, partial fill and rejection.
- Rate limiting, a registered static IP and exchange-compliant order types — market orders on stock options, for example, converted to marketable limits.
- A backtester that runs the same logic as live, with Indian charges and realistic fills.
- Logs you can read after a bad day, and a kill switch you trust.
QuantumCat ships all of it on your own machine, so your time goes into the strategy instead of the plumbing. Download QuantumCat free and build your first bot on paper today.
Questions
Is algo trading legal for retail traders in India?
Yes. Retail traders can automate through their broker’s official API under SEBI’s retail algo framework, in full force since 1 April 2026: API orders come from a static IP registered with the broker, algorithmic orders carry an exchange identifier, and a self-built strategy above 10 orders per second must be registered through the broker. Read your broker’s API terms before running a bot live.
Which broker API is best for algo trading in India?
It depends on cost and data. Dhan’s trading APIs are free and it serves 20-level depth; Zerodha’s Kite Connect is free for orders, with market data on a paid plan; Angel One’s SmartAPI is free; Groww’s Trade API is a paid subscription. QuantumCat supports all four — see the broker comparison.
Can I build a trading bot without coding?
Yes. In QuantumCat you build a bot in the five-step guided builder from indicators, price fields, option-chain metrics, Pulse states and time windows combined with AND, OR and NOT — or describe it to JARVIS, the built-in AI copilot, and review the rules it builds. It backtests with Indian charges and runs in paper mode first.
Does my computer need to stay on for the bot to trade?
Yes. QuantumCat bots run inside the terminal on your own machine, which is what keeps your strategy and credentials off anyone else’s servers. Where your broker supports standing triggers, stops are placed at the broker, so they keep protecting positions if the app closes.
Can a trading bot guarantee profits?
No. A bot executes rules faster and more consistently than a person, but it cannot create an edge the rules don’t have. Prove the edge with an honest backtest and paper trading first — our strategy guide shows how.
Education, not investment advice. QuantumCat is software, not a SEBI-registered investment adviser or research analyst, and nothing on this page is a recommendation to buy or sell any security. Figures from SEBI and the brokers are linked to their sources; broker prices and plans change, so check each broker's own page.