Building a strategy is one thing. Putting it into production at scale is entirely different. Your backtest assumes you can place 1,000 orders per day with zero latency, zero fees, and zero regulation. Live execution hits reality: broker APIs have rate limits (3 orders per second on Kite Connect). SEBI has a circular you've never heard of. Your risk controls are optional suggestions until the market moves 200 points in your face.

This module walks through the complete infrastructure stack for systematic execution in India | the APIs that connect you to exchanges, SEBI's algorithmic trading regulations, and the risk controls that separate professional traders from blown-up retail accounts.

The Indian broker API landscape

Every systematic strategy needs three things from a broker: order placement, market data (real-time and historical), and portfolio monitoring. Indian brokers have mostly solved this with APIs. Let me walk you through the major players:

Zerodha Kite Connect

Market share: The dominant retail API in India. Most systematic traders start here. What it offers: Order placement, live market data via WebSocket, historical OHLC data, portfolio data, account details. Rate limits: 3 orders per second, 200 market data requests per minute (WebSocket is less restricted). Cost: ₹2,000 per month (one-time or recurring). Authentication: OAuth 2.0 with a user redirect flow | you generate an access token, store it, refresh it daily. Libraries: kiteconnect Python library is mature and well-maintained.

I started with Kite Connect in 2019. It's simple, reliable, and the documentation is clear. The catch: you're limited to 3 orders/second, which matters if you're deploying a complex multi-leg strategy. The WebSocket for real-time data is WebSocket-based, which means you need connection management code (reconnect on drop, queue orders if disconnected, etc.).

Upstox API

Cost: Free (no monthly subscription). What it offers: Order placement, live data, historical data, portfolio. Rate limits: 10 orders per second (better than Kite). Authentication: OAuth 2.0, similar flow to Kite. WebSocket: Yes, for live data streaming.

Upstox is growing fast among algo traders because of the free tier and higher order rate limit. The documentation is not as comprehensive as Kite, but sufficient for most use cases.

Angel One SmartAPI

Cost: Free. What it offers: Order placement, live data, historical data. Rate limits: 10 orders per second. Authentication: API token-based (simpler than OAuth). WebSocket: Yes.

SmartAPI is popular with day traders. The authentication flow is simpler than Kite (no OAuth redirect), which makes testing easier. Rate limits are generous (10 OPS).

Others: IIFL, 5paisa, Dhan, Flattrade

These brokers all have APIs, all free or cheap. All have order placement, live data, and WebSocket support. Rate limits vary (typically 5-10 OPS). The key difference is commission structure, execution speed (latency), and reliability of their infrastructure during market crashes. Most have less documentation and smaller developer communities than Kite, so debugging is harder when things break.

Key consideration: authentication and session management

Every API requires you to authenticate and get an access token. Kite Connect tokens expire daily. Upstox tokens are longer-lived. You need production code that handles token refresh automatically | missing a refresh means your strategy silently stops placing orders mid-day. For production systems, this is a critical detail:

SEBI's algo trading circular (February 2025)

In February 2025, SEBI released circular SEBI/HO/MRD/MRD-PoD-2/P/CIR/2025/23, fundamentally changing algo trading regulation in India. This is the single most important regulation change for retail algo traders in the past decade.

The key changes

1. Mandatory Algo-ID registration from April 2026. Every algorithm must be registered with the exchange via your broker. You can't just run Python scripts anymore | each algo needs an Algo-ID assigned by the broker after approval. The registration process includes:

2. Orders Per Second (OPS) threshold: 10 OPS. This is critical. Algos that exceed 10 orders per second must undergo additional compliance review:

3. API-based retail orders will also need Algo-ID tagging. This is the part that surprised most traders. If you're using an API to systematically place orders (even if it's not "algorithmic" in the sense of autonomous decision-making), SEBI now requires that you tag every order with an Algo-ID. This means even a simple systematic rebalance script needs registration.

4. Record-keeping and audit trail: You must maintain complete logs of every order, every cancellation, every execution detail for 5 years minimum. SEBI can audit this during investigations. The format is strict: timestamp, Algo-ID, order details, execution price, execution time, cancellation reason if applicable.

Impact on your strategy

If you're running a systematic strategy on RupeeCase or planning to build your own:

Building your first systematic execution pipeline

The architecture of a systematic execution system is surprisingly simple:

Signal generation → Order management → Execution → Monitoring

Let me break this down:

Signal generation layer

Your strategy produces trading signals (e.g., "buy 100 shares of Reliance at ₹2,450 or better"). These signals are computed once per rebalance interval | daily, hourly, or minute-by-minute depending on your strategy. Store these signals in a queue or database:

Order management layer

Once you have signals, you need to:

Execution layer

Different order types are suited for different scenarios:

Monitoring and error handling

The messy part of production systems is handling failures:

Risk controls every algo must have

SEBI expects these. Your broker expects these. Your accountant will ask for proof of these. You need these so you don't lose your entire portfolio in 3 minutes.

Position limits

Before placing any order, check: What's my current position in this stock? What's my portfolio weight? Never allow a single position to exceed X% of your total portfolio. Example:

This is the simplest risk control and prevents any single bet from dominating your portfolio.

Order rate limits (self-imposed)

You know SEBI's 10 OPS limit. But impose your own limit lower than this. Example: allow maximum 6 OPS. Why? Buffer for unexpected spikes. If your code has a bug that causes order spam, you cap it at 6 instead of hitting the 10 OPS wall and triggering SEBI review.

Max daily loss kill switch

This is critical. Set a threshold: if my strategy is down ₹50,000 today (or 5% of portfolio), stop placing orders. Don't try to recover losses by increasing order size. Stop, investigate, come back tomorrow. Implementation:

Fat finger protection

Your algorithm should never place an order larger than X. Example: max order size ₹2L. If signal says "buy ₹5L", cap it at ₹2L. This prevents runaway orders if your position sizing code has a bug.

Market hours validation

Only place orders during market hours. Prevent accidental orders at 11:59 PM or during market halts. Check: is market open? Simple logic:

Duplicate order detection

This is subtle. Your code generates a signal to buy Reliance. You place the order. API returns a response: "Order placed, order ID 12345". But then your code runs again (maybe cron job ran twice) and generates the same signal. You place the order again. Now you have 2 identical orders in the market.

Prevention: before placing an order, query the broker API for recent orders. Check if an identical order already exists in the market. If yes, skip. This is idempotency.

Network failure handling and recovery

Your code is placing orders. Network breaks. API connection dies. Your code must:

Circuit breaker response

What happens when the market hits a circuit breaker and trading halts for 45 minutes? Your algo keeps running, but orders can't be placed. Options:

The compliance checklist

SEBI's 2025 circular is real. Here's what you need to do (or your broker will do on your behalf):

Algo-ID registration (post-April 2026)

Record keeping (5 years minimum)

Audit trail format

SEBI specifies format: CSV with columns like order_id, timestamp, algo_id, symbol, side (BUY/SELL), quantity, limit_price, order_status (PLACED/EXECUTED/CANCELLED), execution_price, execution_quantity. Store this continuously, not just monthly.

SEBI investigation readiness

If SEBI comes knocking (unlikely, but it happens), they'll ask for:

Have this ready. Not theoretical | keep it organized and timestamped.

Broker's right to shut down your algo

Your broker can shut down your algo at any time if:

You'll get a notification and a chance to explain. But broker has final say. Plan accordingly.

Penalties for non-compliance

Compliance is not optional. It's expensive to ignore.

The RupeeCase Terminal approach

Here's the insight: if building all this from scratch sounds complex, it is. That's why RupeeCase Terminal handles the hard parts:

If you want to execute systematic strategies without managing infrastructure, you track your execution on rupeecase.com.

Why I wrote this module

TK
A note from the author
Why I wrote this module

Algorithmic trading in India sits at a fascinating inflection point. For years, it was the wild west | you could build a Python script, deploy it, and no one asked questions. SEBI's 2025 circular changes that overnight. Suddenly, retail algo traders need to think like regulated entities: compliance, risk controls, audit trails, broker approval.

I built QC Alpha on Zerodha's infrastructure in 2019 when these rules didn't exist. I've now rebuilt it to comply with the 2025 circular. The complexity is real, but the framework is simple: understand the APIs, understand the regulations, implement the risk controls, keep the logs. This module is everything I wish someone had told me when I started.

TK
Tanmay Kurtkoti
Founder & CEO, RupeeCase · 17 years systematic trading · QC Alpha
RC
Execute systematic strategies with SEBI compliance built-in. RupeeCase manages APIs, risk controls, and audit trails | so you focus on strategy, not infrastructure.
Build on RupeeCase →

Quick check, Module 10.3

0 correct · 0 answered
🎉
Module 10.3 complete
3 correct. Continue to Module 10.4 when ready.
RupeeCase Terminal
Put this into practice
Deploy systematic strategies with built-in SEBI compliance, risk controls, and API management. No infrastructure to maintain.
Try RupeeCase Terminal →
Research Lab Qualifier
Path 10, Module 3 of 6 done, complete all 6 + path test to unlock
📍 10.1 Market Microstructure 10.2 Cost of Trading 10.3 Systematic Execution 10.4 → 10.6
Calculator

Broker API Rate Budget

Indian broker APIs throttle retail accounts at 7 to 10 orders per second on average. This budget calculator shows whether your strategy fits.

Quick check, Module 10.3

3 questions. Get 2 right to mark this module complete.

0 of 3 answered
Up next, Module 10.4
Paper Trading to Live: The Hardest Transition
Your backtest shows 22% returns. Your paper trading shows 18%. Your live trading shows 8%. What went wrong, and how to bridge the gap between theory and reality.
Continue →
PRACTICE WHAT YOU LEARNED
Deploy systematic strategies on RupeeCase | free paper trading.
Get Started Free →