Algo Trading - Building Automated Systems for Indian Markets
Algo trading executes trades based on predefined rules without human intervention, removing emotion while scaling strategies 24/7. In India, 50%+ of NSE turnover comes from algorithms, making it essential for competitive edge in Nifty, Bank Nifty and F&O.
Core Components of Algo Systems
Strategy
Logic: Rule-based entries/exits (EMA
crossover, RSI divergence, breakout filters).
Data
Feed: Real-time tick data from NSE via APIs
(Zerodha Kite, Upstox).
Backtesting
Engine: Historical simulation (Amibroker,
Python Backtrader).
Execution
Broker: Low-latency API with order
placement (Streak, Tradetron).
Risk
Manager: Position sizing, daily P&L
stops, circuit breakers.
Popular Algo Strategies for India
Mean
Reversion: Buy oversold RSI (<30) on 5M
Nifty, sell at mean.
Momentum
Breakout: 9:30 AM range expansion with
volume filter.
VWAP
Tracking: Trail stops around intraday VWAP
bands.
Options
Arbitrage: Mispriced straddle adjustments
pre-expiry.
Pair
Trading: Nifty vs Bank Nifty correlation
breakdown.
Setting Up Your First Algo
-
Code Strategy: Python (Pandas + KiteConnect) or no-code platforms (Streak).
-
Backtest: 2+ years data, check Sharpe >1.5, drawdown <15%.
-
Paper Trade: Live simulation 1 month.
-
Go Live: Start with 10% capital, VPS hosting.
Example: EMA Crossover - Buy when 9EMA > 21EMA + volume > avg.
Python Algo Skeleton
pythonimport kiteconnect # Strategy logic if fast_ema > slow_ema and rsi < 70: kite.place_order("MIS", "NSE", "NIFTY", quantity=75) # Risk: Max 1% per trade
Platforms for Indian Traders
-
Zerodha Streak: No-code drag-drop strategies.
-
Tradetron: Marketplace for ready algos.
-
Amibroker: Advanced backtesting + AFL scripting.
-
Python Libraries: KiteConnect + TA-Lib + Backtrader.
Risk Controls (Mandatory)
-
Daily Loss Limit: 2% account → Halt trading.
-
Max Positions: 3 concurrent trades.
-
Slippage Buffer: 0.5-1% in live P&L calc.
-
Kill Switch: Manual override API endpoint.
-
Circuit Breaker: Pause on 5 consecutive losses.
Common Pitfalls
Overfitting: Perfect
backtest fails live → Use walk-forward testing.
Latency: Retail
VPS = 100ms delay → Colocate for HFT.
Data
Quality: Adjusted for splits, dividends.
Broker
Changes: API updates break algos → Weekly
monitoring.
Scaling from Retail to Prop
Retail: 1-5
lakhs, 1-2 strategies.
Prop
Firms: AlgoEdge, AlphaGrep - 10cr+ AUM, 50+
strategies.
Capital
Requirement: SEBI algo approval (>₹1cr
for HFT).
Performance Checklist
-
Sharpe Ratio > 1.2 ✓
-
Max DD < 20% ✓
-
Profit Factor > 1.5 ✓
-
100+ trades sample ✓
-
Live vs Backtest < 10% diff ✓
Algo trading compounds edge through consistency, turning 55% manual win rate into 24/7 execution.