Certified Financial Analyst & Asian Market Specialist
I still remember the first time I watched a pair trade work perfectly. It was October 2023, markets were chopping sideways after an RBI policy hold, and nothing directional was working. I had gone long HDFC Bank and short ICICI Bank based on a simple spread divergence, and within nine trading sessions the spread reverted — netting me roughly ₹38,000 on a ₹4 lakh combined position. That trade changed how I think about the Indian market.
Pair trading is one of those rare strategies that doesn't care whether Nifty goes to 25,000 or crashes to 18,000. You're betting on the relationship between two stocks, not on market direction. And in Indian banking — where HDFC Bank and ICICI Bank move in near-lockstep 80% of the time — the opportunities are surprisingly frequent.
In this guide, I'll walk you through exactly how I identify, execute, and manage pair trades on Nifty stocks, with a focus on the HDFC Bank / ICICI Bank pair that I've been trading since 2022.
What Is Pair Trading and Why It Works in India
Pair trading is a market-neutral strategy. You simultaneously buy one stock (long) and sell another (short) from the same sector, betting that their price ratio will revert to its historical mean. The beauty is that market-wide moves cancel out — if banking stocks crash 5%, both your long and short positions move down together, and your P&L depends only on the relative movement.
India is actually an excellent market for pair trading for a few specific reasons. First, we have clearly defined sectoral stocks that move together — private banks, IT services, oil marketing companies. Second, the F&O segment on NSE gives us liquid futures for shorting (you can't easily short-sell cash market stocks in India). Third, retail participation has exploded since 2020, creating more short-term mispricings between correlated stocks.
The academic term for what makes pair trading work is cointegration. Two stocks are cointegrated when they share a long-term equilibrium relationship — they might diverge temporarily, but they always come back together. This is different from simple correlation. Two stocks can be highly correlated (both go up in a bull market) without being cointegrated (they might drift apart permanently).
Think of it like two dogs tied to the same lamppost with elastic leashes. They can wander in different directions, but the leash always pulls them back. That elastic leash is cointegration.
Finding Cointegrated Pairs on Nifty
Not every pair of similar-looking stocks is suitable for pair trading. I've tested dozens of combinations, and here are the ones that have shown consistent cointegration over the last 3-5 years:
| Pair | Sector | Correlation (3Y) | Cointegration p-value | Avg Reversion (Days) |
|---|---|---|---|---|
| HDFC Bank / ICICI Bank | Private Banking | 0.91 | 0.003 | 8-12 |
| TCS / Infosys | IT Services | 0.88 | 0.011 | 10-15 |
| BPCL / HPCL | Oil Marketing | 0.85 | 0.008 | 7-11 |
| SBI / Bank of Baroda | PSU Banking | 0.79 | 0.024 | 12-18 |
| Hindalco / Tata Steel | Metals | 0.76 | 0.037 | 14-20 |
A p-value below 0.05 on the Engle-Granger cointegration test means we can reject the null hypothesis of no cointegration — in plain terms, there's a statistically significant long-term relationship. The lower the p-value, the stronger the cointegration.
I run this test every quarter using Python (the statsmodels library has a built-in coint() function), but you can also do a simplified version in Excel. The key insight: HDFC Bank / ICICI Bank consistently shows the strongest cointegration among all Nifty pairs, which is why it's my go-to.
The Z-Score Entry System
Once you've identified a cointegrated pair, you need a trigger to tell you when the spread has diverged enough to trade. This is where the z-score comes in.
The z-score measures how many standard deviations the current spread is from its mean. Here's the step-by-step calculation:
Step 1: Calculate the price ratio. For HDFC Bank at ₹1,680 and ICICI Bank at ₹1,120, the ratio is 1,680/1,120 = 1.50.
Step 2: Calculate the 60-day rolling mean of this ratio. Let's say it's 1.48.
Step 3: Calculate the 60-day rolling standard deviation. Let's say it's 0.03.
Step 4: Z-score = (Current Ratio - Mean) / Std Dev = (1.50 - 1.48) / 0.03 = 0.67
My entry rules are straightforward:
- Z-score above +2.0: Short HDFC Bank, Long ICICI Bank (the ratio is too high, meaning HDFC is relatively overpriced)
- Z-score below -2.0: Long HDFC Bank, Short ICICI Bank (the ratio is too low, meaning HDFC is relatively cheap)
- Exit: Z-score returns to 0 (mean reversion complete) or hits ±0.5
- Stop loss: Z-score reaches ±3.0 (the relationship might be breaking down)
In Excel, you can set this up in about 15 minutes. Column A for dates, Column B for HDFC Bank close, Column C for ICICI Bank close, Column D for the ratio (=B2/C2), Column E for 60-day average (=AVERAGE(D2:D61)), Column F for 60-day standard deviation (=STDEV(D2:D61)), and Column G for the z-score (=(D2-E2)/F2).
Position Sizing and Execution
Position sizing in pair trading is different from directional trading because you need to balance the rupee exposure on both legs. If you go long ₹5 lakh of HDFC Bank, you should short approximately ₹5 lakh of ICICI Bank — not the same number of shares, but the same rupee value.
I use Nifty futures for execution because the lot sizes make the math cleaner. HDFC Bank futures have a lot size of 550 shares, and ICICI Bank futures have a lot size of 700 shares. At current prices, one lot of HDFC Bank futures is roughly ₹9.24 lakh and one lot of ICICI Bank futures is roughly ₹7.84 lakh. To balance, I sometimes need to adjust with additional cash market positions.
For someone starting out with a ₹5 lakh account, I'd recommend using the cash market with proper margin (available through Exness for forex pairs or your regular Indian broker for equities). Keep total exposure under 40% of your capital — meaning ₹1 lakh long and ₹1 lakh short for a ₹5 lakh account.
Execution timing matters. I enter both legs simultaneously at 9:30 AM IST, right after the opening volatility settles. I use limit orders, not market orders, and I always place the harder leg first (usually the short side, since short-selling can have liquidity issues in certain stocks).
My HDFC Bank / ICICI Bank Trade Journal
Let me share some actual trades I've taken on this pair to give you a realistic sense of what to expect:
Trade 1 (March 2025): Z-score hit +2.3. Shorted HDFC Bank at ₹1,710, went long ICICI Bank at ₹1,095. Spread reverted in 7 days. Profit: ₹22,400 on ₹4 lakh combined position. That's 5.6% in a week, market-neutral.
Trade 2 (January 2026): Z-score hit -2.1. Went long HDFC Bank at ₹1,640, shorted ICICI Bank at ₹1,150. This one took 14 days to revert, and I got nervous around day 10 when the z-score hit -2.4. But it came back. Profit: ₹18,600.
Trade 3 (February 2026): Z-score hit +2.5 during budget week volatility. Shorted HDFC Bank, longed ICICI Bank. This was a loss — the spread widened to +3.1 and I stopped out. Loss: ₹14,200. Budget-related events can temporarily break cointegration.
My overall win rate on this pair over 2024-2026 is approximately 68%, with an average win of ₹19,000 and average loss of ₹12,000. That gives a positive expectancy of roughly ₹5,800 per trade. I get about 3-4 signals per quarter, so the annual contribution from this single pair is around ₹70,000-₹90,000.
Common Mistakes and How to Avoid Them
After three years of pair trading Indian stocks, I've made every mistake in the book. Here are the ones that cost me the most:
Mistake 1: Ignoring structural breaks. When HDFC Bank merged with HDFC Ltd in July 2023, the cointegration with ICICI Bank temporarily broke. The ratio shifted to a new level, and old mean/standard deviation calculations were useless. Lesson: any major corporate event (merger, demerger, large equity raise) resets the relationship. Wait 60+ days of new data before trading again.
Mistake 2: Trading too many pairs simultaneously. I once had five pair trades open — HDFC/ICICI, TCS/Infosys, BPCL/HPCL, SBI/BoB, and Hindalco/Tata Steel. A broad market shock hit, and suddenly all my "uncorrelated" pairs were moving against me together. Sector-level correlations increase during stress. Keep it to 2-3 pairs maximum from different sectors.
Mistake 3: Not accounting for dividends. Indian banking stocks pay decent dividends, and ex-dividend dates can create artificial spread movements. HDFC Bank going ex-dividend while ICICI Bank hasn't yet will make the ratio drop temporarily. This isn't a real divergence — don't trade it. Keep a calendar of ex-dividend dates for both stocks in your pair.
Mistake 4: Using too short a lookback period. I initially used a 20-day rolling window for z-score calculation. The signals were frequent but low quality. Switching to 60 days dramatically improved the win rate. Longer lookback = fewer but better trades.
If you're also interested in understanding broader market forces that drive these banking pairs, check out my guide on intermarket analysis for Indian markets — bond yields have a direct impact on HDFC vs ICICI relative performance.
Pair trading won't make you rich overnight. It's a grinder's strategy — small, consistent profits that compound over time. But in a market where most retail traders lose money trying to predict Nifty's direction, making ₹70,000-₹90,000 a year from a single market-neutral pair isn't bad at all. And the beauty is, it works in bull markets, bear markets, and everything in between.
Start with paper trading. Track the HDFC Bank / ICICI Bank ratio in Excel for one month. Calculate the z-score daily. When you see a signal, write down what you would have done. After 3-4 paper trades, you'll have the confidence to go live with small size. That's exactly how I started, and I haven't looked back.