Algorithmic Statistical Arbitrage: Paired Trading with Cointegration
Strategy Overview
Algorithmic statistical arbitrage, specifically paired trading, capitalizes on the temporary mispricing of two historically correlated assets. This strategy identifies pairs of assets whose prices move together over the long term, even if their short-term movements diverge. Cointegration analysis confirms the statistical relationship between the assets. The strategy involves simultaneously buying the underperforming asset and selling the outperforming asset when their price spread deviates significantly from its historical mean. It profits when the spread reverts to its average.
Pair Selection and Cointegration
Select highly liquid assets from the same sector or industry, e.g., two major oil companies or two retail giants. The assets must exhibit a strong historical correlation (Pearson correlation coefficient > 0.85 over 252 trading days). Perform a Johansen or Engle-Granger cointegration test on the historical price series (e.g., last 500 daily closes). The p-value for the cointegration test must be less than 0.05, confirming a statistically significant long-term relationship. Calculate the historical spread between the two assets. This spread can be a simple price difference or a ratio, normalized by standard deviation (Z-score). The Z-score is calculated as (current spread - mean spread) / standard deviation of spread.
Entry Rules
Long Spread (Buy A, Sell B)
Initiate a long spread position when the Z-score of the spread falls below -2.0 standard deviations. This indicates that asset A is significantly underperforming asset B relative to their historical relationship. Both assets must retain their fundamental correlation (>0.80) over the last 60 periods. Volume on the divergence candle (the candle pushing Z-score below -2.0) must be 1.5 times the 20-period average for both assets. Entry occurs at the open of the next candle after the Z-score crosses the threshold. Ensure sufficient liquidity for both assets to execute simultaneous orders without significant slippage.
Short Spread (Sell A, Buy B)
Initiate a short spread position when the Z-score of the spread rises above +2.0 standard deviations. This indicates that asset A is significantly outperforming asset B relative to their historical relationship. Both assets must retain their fundamental correlation (>0.80) over the last 60 periods. Volume on the divergence candle (the candle pushing Z-score above +2.0) must be 1.5 times the 20-period average for both assets. Entry occurs at the open of the next candle after the Z-score crosses the threshold. Ensure sufficient liquidity for both assets to execute simultaneous orders without significant slippage.
Exit Rules
Long Spread Exit
Close the long spread position when the Z-score of the spread crosses above -0.5 standard deviations. This indicates a partial mean reversion. Alternatively, exit if the Z-score crosses above +1.0 standard deviations, signaling a full mean reversion and potential reversal. A time-based exit triggers if the position remains open for 20 periods without the Z-score returning above -0.5. This prevents prolonged exposure to non-converging pairs.
Short Spread Exit
Close the short spread position when the Z-score of the spread crosses below +0.5 standard deviations. This indicates a partial mean reversion. Alternatively, exit if the Z-score crosses below -1.0 standard deviations, signaling a full mean reversion and potential reversal. A time-based exit triggers if the position remains open for 20 periods without the Z-score returning below +0.5. This prevents prolonged exposure to non-converging pairs.
Risk Management
Stop Loss
For both long and short spreads, place a stop loss when the Z-score of the spread reaches -3.0 or +3.0 standard deviations (depending on the trade direction). This indicates a breakdown of the historical relationship. Calculate the maximum potential loss based on the Z-score deviation and the historical volatility of the spread. Ensure the spread stop loss is absolute and does not move. The core assumption of mean reversion fails if the spread continues to diverge significantly. Do not override this stop loss.
Position Sizing
Allocate 0.3% of total capital per pair trade. Calculate position sizes for each leg of the pair to maintain dollar neutrality or beta neutrality, depending on the strategy's specific objective. For example, if asset A is $100 and asset B is $50, and beta is 1.2, for every 100 shares of A, short 240 shares of B ($100 * 100 shares = $10,000; $50 * 240 shares = $12,000, adjusted for beta). This minimizes directional market risk. Limit total portfolio risk to 1.5% across all open pair trades. Maximum concurrent pairs: 5. This prevents overexposure to any single sector or market shock.
Practical Application
This strategy thrives in stable market environments with clear sector relationships. It struggles during periods of high market dislocation or structural changes within industries, which can break historical correlations. Apply this strategy to highly liquid equity pairs, ETF pairs, or commodity futures pairs (e.g., WTI vs. Brent crude). Use daily or 4-hour timeframes for calculating spreads and Z-scores. Shorter timeframes introduce excessive noise. Backtest extensively over multiple market regimes, ensuring the cointegration relationship holds true across different economic cycles.
Automate the continuous calculation of Z-scores and signal generation. Implement robust order execution for simultaneous buying and selling to minimize leg risk. Monitor pair correlations daily. If a pair's correlation drops below 0.70 for 10 consecutive periods, remove it from the trading universe. Regularly re-evaluate the cointegration relationships of all active pairs (e.g., quarterly). Adjust stop-loss thresholds based on historical extreme Z-score deviations for specific pairs. The target profit factor for this strategy should be above 1.8. Consistent small profits from mean reversion define this strategy's edge. Execute without emotional interference. The statistical validity of the cointegration relationship is paramount. Without it, the strategy becomes a directional bet.
