Intermediate

Case Study: Backtesting a Pairs Trade on Indian Banking Stocks

A hands-on, end-to-end case study for aspiring quant analysts, prop desk applicants and traders who want to systematise a market-neutral idea. You will take the classic pairs trade, going long one bank and short another when their price relationship stretches too far, and turn it into a working Python backtest on Nifty Bank constituents. Along the way you will learn why correlation is the wrong test and cointegration is the right one, how to estimate a hedge ratio and the half-life of the spread, how to build a z-score signal engine in pandas, and how the two-leg cost stack in India, including STT, SLB borrowing fees and stock futures rollovers, changes the answer. The course ends with a verdict on whether the chosen pair actually paid, and a checklist of what to test before risking a rupee.

Pairs TradingStatistical ArbitrageCointegrationBacktestingPython for FinanceNifty BankShorting in IndiaWalk-Forward Testing
MODULES
4
DURATION
~3 hrs
TRACK
Algorithmic Trading

What You'll Master

What a pairs trade is, why it is market-neutral in theory and not quite in practice, and why Indian banking stocks are a natural hunting ground
The difference between correlation and cointegration, and how to run the Engle-Granger and ADF tests on NSE price data in Python
How to estimate a hedge ratio, build the spread, and measure its half-life so you know how long a trade should take to converge
How to write a z-score entry and exit engine in pandas without look-ahead bias, and how to size the two legs rupee-neutral or beta-neutral
How shorting actually works in India: intraday cash, SLB borrowing and single-stock futures, and what each costs
How to price the full two-leg cost stack, including brokerage, STT, exchange charges, slippage and futures rollover, and subtract it from the gross curve
How to read the results with Sharpe ratio, maximum drawdown, trade count and regime breaks, and how to spot a pair that has quietly stopped cointegrating
How to run walk-forward and parameter sensitivity tests so the verdict survives out-of-sample, and what to check before going live
Access Level
LEARNER
Everything included
Full Text Playbooks
Actionable Exercises
Mobile Reading Mode
Lifetime Updates

Curriculum Breakdown