Introduction
Pair trading is a popular market-neutral trading strategy that aims to profit from the relative price movement between two correlated assets. Unlike traditional directional trading, pair trading does not depend on whether the market goes up or down. Instead, it focuses on the relationship between two securities.
This strategy is widely used by hedge funds, quantitative traders, and advanced retail traders because of its ability to reduce market risk while targeting consistent returns.
What is Pair Trading?
Pair trading involves selecting two stocks (or assets) that historically move together due to similar business models, sectors, or economic factors.
Example:
- Stock A: Reliance Industries
- Stock B: ONGC
If both belong to the same sector (energy), they usually maintain a stable price relationship.
Core Concept
The idea is simple:
- When the price relationship diverges abnormally, a trading opportunity arises.
- You buy the undervalued stock and short the overvalued stock.
- When the prices revert back to their normal relationship, you exit with profit.
How Pair Trading Works
Step-by-Step Process:
-
Select a Pair
- Choose two highly correlated stocks.
- Example: HDFC Bank vs ICICI Bank
-
Measure Relationship
-
Use tools like:
- Correlation
- Cointegration
- Z-Score
-
Use tools like:
-
Calculate Spread
- Spread = Price of Stock A – Price of Stock B
-
Standardize Spread (Z-Score)
- Helps identify extreme deviations.
-
Entry Signals
- Z-Score > +2 → Short A, Buy B
- Z-Score < -2 → Buy A, Short B
-
Exit Signals
- Z-Score returns to 0 (mean reversion)
Why Pair Trading Works
Markets are not perfectly efficient. Even strongly related stocks temporarily move apart due to:
- News events
- Institutional activity
- Market sentiment
- Short-term imbalance
Pair trading exploits this temporary mispricing.
Advantages of Pair Trading
1. Market Neutral
Profit does not depend on overall market direction.
2. Reduced Risk
Hedged positions (long + short) lower exposure.
3. Consistency
Works well in sideways markets.
4. Quant-Friendly
Can be fully automated using algorithms (AFL, Python, etc.)
Risks Involved
1. Breakdown of Correlation
Stocks may stop moving together.
2. Structural Changes
Company fundamentals may change.
3. Execution Risk
Slippage, delay in orders.
4. Overfitting
Backtest results may not work in real markets.
Important Metrics
- Correlation (> 0.7 preferred)
- Cointegration (more reliable than correlation)
- Z-Score (entry/exit timing)
- Half-life of mean reversion
Types of Pair Trading
-
Statistical Arbitrage
- Based on mathematical models
-
Fundamental Pair Trading
- Based on company analysis
-
Sector-Based Pair Trading
- Example: Bank vs Bank, IT vs IT
Practical Example
Suppose:
- Stock A = ₹100
- Stock B = ₹95
- Normal spread = ₹5
Now spread becomes ₹10 → divergence
Trade:
- Short Stock A
- Buy Stock B
When spread returns to ₹5 → exit profit
Tools for Pair Trading
- AmiBroker (AFL scripting)
- TradingView (Pine Script)
- Python (Pandas, NumPy)
- Excel (for basic analysis)
Best Practices
- Always test pairs on historical data
- Use stop-loss even in hedged trades
- Avoid highly volatile or unrelated stocks
- Monitor fundamental changes
- Trade only liquid stocks
Conclusion
Pair trading is a powerful strategy for traders who prefer low-risk, consistent, and systematic trading approaches. By focusing on relative value rather than market direction, traders can generate returns even in uncertain conditions.
However, success in pair trading requires:
- Proper pair selection
- Strong statistical validation
- Discipline in execution
When combined with automation (like AFL or algorithmic systems), pair trading can become a highly efficient trading method.






