Free Algo Trading Course for NSE & BSE: 134 Chapters, Zero to Live
This is the course we wish existed when we started building ServLoci: not another "80% win rate" pitch, but the full machinery — broker auth, order types, risk sizing, backtesting rigor, options math, statistics, and the operational discipline — needed to run a strategy live on NSE/BSE without learning the hard way. It also covers SEBI's 2026 retail algo framework in detail, including the static IP whitelisting requirement that's now mandatory for every API order — exactly the problem ServLoci's static IP product exists to solve.
134 chapters, each one small and runnable. Start at chapter 1 and work through in order.
100 chapters. Each chapter = one small, runnable step. Progress in order — later chapters assume earlier ones are done. Style modeled on "Go by Example": short explanation, minimal working code, no fluff.
Reference broker SDK: Zerodha Kite Connect (pip install kiteconnect) — widest adoption, well-documented, good for learning the concepts. Where another broker (Upstox, Fyers, Dhan, AliceBlue, 5paisa) differs in a way that matters, the chapter notes it. The concepts transfer 1:1 — every Indian broker API is some variation of: auth → profile → funds → orders → positions → websocket ticks.
Prerequisites: Python 3.10+, a demat+trading account with API access, comfort with the command line. No prior live-trading experience assumed.
Not covered as "quick wins": this course does not hand you a strategy with a win rate. It teaches the machinery — auth, orders, risk, ops, tax — so that when you do design a strategy, you can run it without blowing up on execution mechanics you didn't know existed.
Last fact-checked: September 2026. Lot sizes, STT rates, broker pricing, and — most importantly — SEBI's retail algo trading framework (chapter 134) all changed materially in 2026. Read chapter 134 before deploying anything live; several earlier chapters now cross-reference it for requirements (static IP whitelisting, Strategy ID registration) that didn't exist when API trading first became accessible to retail traders.
Part 1 — Setup & Auth (1-10)
- Why algo trading, and how this course works
- Choosing a broker with API access
- Sign up: trading + demat account
- Enable API access / create a Kite Connect app
- Environment setup: venv, SDK install
- Store credentials securely
- Generate the login URL, manual login flow
- Handle the redirect and request token
- Exchange request token for an access token
- Persist and refresh the access token daily
Part 2 — Account & Profile (11-20)
- Get user profile
- Get equity funds/margins
- Get commodity/currency margins
- Understand margin components
- Get holdings (demat, T+1+)
- Get positions (day + net)
- CNC vs MIS vs NRML
- Get order book (order history)
- Get trade book (executed fills)
- Handle API errors and rate limits
Part 3 — Instruments & Market Data (21-35)
- Download the instrument master
- Search an instrument by symbol
- instrument_token vs tradingsymbol
- Get LTP for symbols
- Get full quote (OHLC + depth summary)
- Get market depth (5-level book)
- Fetch historical daily candles
- Fetch historical intraday candles
- Historical data limits and pagination
- Store historical data locally
- Corporate actions and adjusted price
- F&O instrument fields: expiry, lot size, strike
- Build an option chain
- Track index spot values
- Build a watchlist manager
Part 4 — WebSocket & Live Data (36-42)
- Connect to the WebSocket ticker
- Subscribe to instrument tokens
- Handle LTP-mode ticks
- Handle full-mode ticks (depth, OI)
- Reconnect logic and connection health
- Buffer ticks for downstream processing
- Build an in-memory live price cache
Part 5 — Orders: Basics (43-58)
- Anatomy of an order
- Place a CNC market BUY order
- Place a CNC market SELL order
- Place a CNC limit BUY order
- Place a CNC limit SELL order
- Place an MIS market order
- Place an MIS limit order
- Place a stop-loss (SL) order
- Place a stop-loss-market (SL-M) order
- Bracket and cover orders
- Get order status by order_id
- Modify a pending order
- Cancel a pending order
- Handle partial fills
- Handle order rejections
- Idempotent order placement
Part 6 — Orders: Advanced (59-68)
- Place a GTT order
- Multi-leg option orders
- Basket order placement
- After-market orders (AMO)
- Freeze quantity and order splitting
- Slicing large orders
- Tagging orders by strategy
- Reconciling local state vs broker order book
- Building an Order Manager abstraction
- Broker-agnostic order interface
Part 7 — Positions, Risk & Sizing (69-78)
- Track open positions and unrealized P&L
- Square off intraday positions before close
- Position sizing basics
- ATR-based position sizing
- Risk per trade and daily loss limit
- Portfolio-level exposure limits
- Automating stop-loss and target
- Trailing stop-loss
- Handling circuit limits and illiquid symbols
- Margin-aware order sizing
Part 8 — Strategy & Backtesting (79-88)
- From idea to testable hypothesis
- Signal functions on OHLC data
- Backtest engines: vectorized vs event-driven
- Backtest on NSE data with vectorbt
- Look-ahead bias and survivorship bias
- Walk-forward validation
- Overfitting red flags
- Modeling slippage and transaction costs
- Paper trading mode
- From backtest to live: the strategy state machine
Part 9 — Operations, Monitoring & Compliance (89-98)
- Logging and trade journaling
- Building a kill switch
- Alerting via Telegram
- Heartbeat and API downtime handling
- Running the bot as a service
- Handling broker API changes
- Backup, recovery, and state persistence
- Taxation basics for algo traders in India
- Record-keeping and turnover for tax audit
- Psychology: staying hands-off in drawdowns
Part 10 — Capstone (99-100)
Part 11 — Technical Indicators (101-112)
- Trend indicators: SMA, EMA, WMA
- MACD
- RSI
- Bollinger Bands
- Stochastic Oscillator
- ADX / DMI (trend strength)
- ATR and Supertrend
- VWAP
- Ichimoku Cloud
- Volume indicators: OBV, volume profile
- Pivot points and Fibonacci levels
- Computing all indicators in one pipeline
Part 12 — Indicator Confluence & Intersections (113-117)
- Generic crossover/intersection detection
- Weighted confluence scoring across indicators
- Combining conditions: AND / OR / threshold logic
- Divergence detection (price vs indicator)
- Backtesting a multi-indicator confluence strategy
Part 13 — Options Pricing & Greeks (118-125)
- The Black-Scholes model
- Greeks: Delta, Gamma, Theta, Vega, Rho
- Implied volatility (Newton-Raphson solve)
- Put-call parity
- Portfolio-level Greeks aggregation
- Historical vs implied volatility, IV rank/percentile
- Payoff diagrams for multi-leg strategies
- Delta-neutral hedging
Part 14 — Statistics for Trading (126-133)
- Descriptive stats: min, max, mean, median, mode
- Distribution shape: skew, kurtosis, percentiles
- Frequency distributions and return histograms
- Slippage statistics: measuring and aggregating
- Trade performance stats: win rate, expectancy, profit factor
- Risk-adjusted returns: Sharpe, Sortino, Calmar
- Correlation and covariance across instruments
- Statistical significance and robustness testing