
Chapter 3 | 2 min read
Algo Strategy: Pairs Trading – Neutral & Smart
Imagine this:
Two friends usually walk side by side. One day, one walks faster and moves ahead. You expect the other to catch up soon.
That’s Pairs Trading in a nutshell.
It’s a market-neutral strategy where you trade two related stocks — betting that their price relationship will return to normal.
What is Pairs Trading?
You buy one stock and short the other.
Let’s say:
- You pick BANK A and BANK B (both in same sector)
- Usually, their price ratio is stable
- Suddenly, BANK A runs ahead but BANK B lags
You go:
- Short BANK A
- Long BANK B
When the price relationship returns to normal, you close both positions — and hopefully pocket the profit.
Why It Works
- Stocks in the same sector often move together
- Temporary divergences happen due to news, panic, or low liquidity
- They tend to mean-revert over time
This strategy doesn't depend on overall market direction — so it works in bull, bear, or sideways markets.
How Does an Algo Do It?
-
Pick Pairs: Use historical data to find stocks that move together — called cointegration.
-
Track Spread: Calculate the difference or ratio between the two prices.
-
Set Thresholds:
a. If spread widens too much → enter trade
b. If spread comes back to normal → exit trade -
Manage Risk:
a. Set stoploss in case divergence continues
b. Use equal capital allocation on both sides
Watchouts
- You need statistical tools to find cointegrated pairs — it’s not just random stock matching
- Sharp news (like quarterly results) can break the correlation
- Algo should re-test pairs often — relationships change
Bonus Tip
You can also try:
- ETF vs Stock pairs (e.g., Bank Nifty ETF vs Axis Bank)
- Sector Leader vs Laggard plays
- International ADRs vs Indian stocks (for advanced users)
Pairs trading is like hedged arbitrage — less risky but needs discipline and precision. It’s a favorite of many quant traders.
Next up, let’s learn about a more structured and widely used strategy — VWAP-based trading used by institutions.
Recommended Courses for you
Beyond Stockshaala
Discover our extensive knowledge center
Learn, Invest, and Grow with Kotak Videos
Explore our comprehensive video library that blends expert market insights with Kotak's innovative financial solutions to support your goals.













