Pair Trading Indicators
1 Statistical Indicators
1.1 Correlation Analysis
Purpose: Measure the strength of linear relationship between two asset price series.
How:
- Computed using the Pearson correlation coefficient.
- Inputs: Price series of both assets.
- Outputs: A value between -1 and 1.
Interpretation:
- Values close to 1 indicate strong positive correlation.
- Values close to -1 indicate strong negative correlation.
- Values close to 0 indicate little or no correlation.
- For pair trading, correlations above 0.7 are generally desirable.
1.2 Cointegration Test
Purpose: Test for a long-term equilibrium relationship between two asset price series.
How:
- Computed using
coint()
fromstatsmodels.tsa.stattools
. - Inputs: Price series of both assets.
- Outputs: Test statistic and p-value.
Interpretation:
- p-value < 0.05: Reject the null hypothesis of no cointegration.
- A p-value below 0.05 suggests the pair is suitable for trading, indicating that prices may diverge temporarily but tend to revert to equilibrium.
1.3 Augmented Dickey-Fuller (ADF) Test
Purpose: Test whether the spread between two assets is stationary.
How:
- Computed using
adfuller()
fromstatsmodels.tsa.stattools
. - Input: Log spread between two assets (i.e. log price A - log price B).
- Outputs: Test statistic and p-value.
Interpretation:
- p-value < 0.05: Reject the null hypothesis of non-stationarity.
- Indicates that the spread is stationary and likely to mean-revert.
- Suitable for pair trading when p < 0.05.
1.4 Half-Life Calculation
Purpose: Measure how quickly the spread reverts to its mean.
How:
- Based on the Ornstein-Uhlenbeck mean-reversion process.
- Derived from a regression of the spread change against its lagged value.
Formula:
- Run an AR(1) regression on the spread series: \[ \Delta \text{Spread}_t = \alpha + \rho \cdot \text{Spread}_{t-1} + \varepsilon_t \]
- Then calculate the half-life using: \[ \text{Half-life} = \frac{-\ln(2)}{\rho} \]
Interpretation:
- 5-25 days: Ideal half-life range for pair trading.
- < 5 days: Very rapid mean reversion, may lead to frequent trading.
- 25-60 days: Slower mean reversion, requiring longer holding periods.
- > 60 days or negative: May not be suitable for pair trading.
2 Trading Signals
2.1 Z-Score
Purpose: Measure how many standard deviations the current spread deviates from its mean.
How:
- Based on the rolling mean and standard deviation of the spread.
- Formula: \[ \text{Z-score} = \frac{\text{Current Spread} - \text{Rolling Mean}}{\text{Rolling Standard Deviation}} \]
- Typically uses a 20-day rolling window.
Interpretation:
- |Z-score| > 2: Typical entry signal threshold.
- |Z-score| < 0.5: Typical exit signal threshold.
- High absolute Z-score values indicate extreme divergence from the normal relationship.
2.2 VIX-Adjusted Thresholds
Purpose: Adapt entry thresholds based on market volatility.
How:
- Uses VIX index levels to adjust the Z-score thresholds.
- Higher VIX values lead to higher threshold requirements.
Interpretation:
- VIX < 20: Entry threshold = 2.0
- VIX 20-25: Entry threshold = 2.25
- VIX 25-30: Entry threshold = 2.5
- VIX > 30: Entry threshold = 3.0
- A higher threshold during periods of high volatility reduces false signals.
3 Trade Execution
3.1 Entry Signals
Purpose: Determine when to enter pair trades.
How:
- Based on the Z-score crossing the adjusted threshold values.
- Signal Examples:
- Z-score > threshold: Short asset A, Long asset B.
- Z-score < -threshold: Long asset A, Short asset B.
Interpretation:
- A positive Z-score indicates that the spread is wider than normal.
- A negative Z-score indicates that the spread is narrower than normal.
- A large absolute Z-score suggests a higher probability of mean reversion.
3.2 Exit Signals
Purpose: Determine when to exit pair trades.
How:
- Primary exit: When the Z-score returns to the ±0.5 range.
- Secondary exits: Based on time-based or risk-based conditions.
Additional Exit Conditions:
- Maximum holding time: 1.5 × half-life days.
- Stop-loss: 5% divergence between the pair.
4 Performance Metrics
4.1 Trade Success Rate
Purpose: Measure the percentage of profitable trades.
How:
- Calculated as: \[ \text{Trade Success Rate} = \left(\frac{\text{Number of Profitable Trades}}{\text{Total Number of Trades}}\right) \times 100\% \]
Interpretation:
- Higher percentages indicate a more reliable strategy.
- Should be evaluated alongside the average profit or loss per trade.
4.2 Total Return
Purpose: Measure the overall profitability of the strategy.
How:
- Calculated as: \[ \text{Total Return} = \left(\frac{\text{Final Portfolio Value} - \text{Initial Portfolio Value}}{\text{Initial Portfolio Value}}\right) \times 100\% \]
Interpretation:
- Positive values indicate a profitable strategy.
- Should be compared to benchmark returns over the same period.
4.3 Alpha & Beta
Purpose: Measure performance relative to a benchmark and sensitivity to market movements.
How:
- Perform a linear regression of strategy returns ( r_s ) against benchmark returns ( r_b ).
- Formula: \[
r_s = \alpha + \beta r_b + \varepsilon
\] where:
- ( ) = Alpha (strategy’s excess return independent of the market)
- ( ) = Beta (sensitivity to market movements)
- ( ) = Residuals (errors)
Interpretation:
- Alpha > 0: Outperformance vs. benchmark.
- Beta ≈ 0: Market-neutral; low market risk exposure.
- Beta > 1: Strategy more volatile than market.
4.4 Volatility
Purpose: Measure the degree of variation in strategy returns.
How:
Computed as the standard deviation of periodic returns ( r_t ).
Formula: \[ \text{Volatility} = \sqrt{\frac{1}{n-1} \sum_{t=1}^{n} (r_t - \bar{r})^2} \] where:
- ( r_t ) = return at time ( t )
- ( {r} ) = average return
- ( n ) = number of periods
Interpretation:
- Higher volatility indicates larger swings in returns.
- Prefer lower volatility for more stable strategies.
4.5 Geometric Mean Rate of Return (GMRR)
Purpose: Capture the compounded average rate of return per period.
How:
- Computed as: \[ \text{GMRR} = \left(\prod_{i=1}^n (1 + r_i)\right)^{\frac{1}{n}} - 1 \] where (r_i) are the periodic returns.
Interpretation:
- Provides a more accurate measure of return over time, accounting for compounding.
4.7 Average Return per Trade
Purpose: Measure the average profitability of each trade.
How:
- Computed as: \[ \text{Average Return per Trade} = \frac{\text{Total Return}}{\text{Number of Trades}} \]
Interpretation:
- Higher values indicate more profitable trades.
4.8 Average Number of Trades per Year
Purpose: Annualize trading activity based on backtest data.
How:
- Computed by scaling the number of trades by the ratio of 12 months to backtest months.
- Example: 35 trades over 3 months → (35 = 140) trades per year.
Interpretation:
- Helps assess strategy activity and transaction cost implications.
5 Summary of Screening Criteria
Indicator | Test | Threshold | Purpose |
---|---|---|---|
Correlation | Pearson | ( > 0.7 ) | Co-movement detection |
Cointegration | Coint | p < 0.05 | Long-term equilibrium |
ADF Test | ADF | p < 0.05 | Mean reversion confirmation |
Half-Life | AR(1) | 5–60 days | Timeframe viability |
Z-Score | Rolling | ±2.0 to ±3.0 | Entry/exit signal strength |
These indicators form the statistical and performance backbone of our market-neutral pairs trading framework. Each filter and metric adds a layer of validation to improve trade quality, reduce noise, and enhance strategy evaluation.