Back to Projects
ResearchStarted: June 2024

Pairs Trading Methods

Shipping stocks are volatile, cyclical, and nearly impossible to time. But what if that chaos is exactly what makes them perfect for pairs trading?

Why This Project

Shipping stocks are a trader's nightmare. Long-term returns barely beat inflation. Volatility makes crypto look stable. Timing tops and bottoms? Forget it—by the time you see the cycle turning, it's too late.

But here's the thing: what if volatility isn't the enemy? What if you could profit because shipping is chaotic?

I stumbled on Krauss's (2015) review of pairs trading strategies—market-neutral approaches that generate 7-11% excess returns by exploiting temporary mispricings between related securities. The kicker? These strategies perform best during volatile periods and market downturns. Exactly when shipping markets are most unpredictable.

Could the very chaos that makes shipping unbuyable as a directional bet make it perfect for pairs trading? To find out, I'm implementing the methods from Krauss's review.

What Is Pairs Trading

Pairs trading is a market-neutral strategy that profits from temporary mispricings between correlated securities. When two stocks that normally move together diverge, you bet on them converging again—going long the underperformer and short the outperformer.

The beauty is that you're betting on the relationship, not market direction. If both stocks crash, your long loses but your short wins. If both rally, the opposite. You only care about the spread between them.

The Methods

1. Distance Approach (GGR)

Status: ImplementedRead my backtest results

The classic approach from Gatev, Goetzmann & Rouwenhorst (2006). Uses Sum of Squared Distances to find securities with historically similar price movements. Pairs are formed during a formation period and traded when the spread exceeds 2 standard deviations.

This is the benchmark to beat. According to Zhu (2024), it still generates an excess return of over 6% per year. My own tests were less optimistic—but the methodology is sound and well-documented.

Strengths: Simple, transparent, robust to data snooping

Weaknesses: Prone to low-variance spreads (limiting profits), no formal cointegration testing

2. Cointegration Approach

Status: Planned

Uses Engle-Granger or Johansen tests to identify pairs with formal equilibrium relationships. More econometrically sound than the distance approach—you're testing for actual mean-reverting relationships rather than just historical similarity.

Strengths: Lower divergence risk, proper equilibrium testing

Weaknesses: Computationally intensive, multiple comparison problems (false positives)

3. Time Series Approach

Status: Planned

Models the spread as a mean-reverting process to optimize entry/exit thresholds. Methods include Kalman filtering, Ornstein-Uhlenbeck processes, and Markov regime-switching models.

Strengths: Optimal threshold calculation, expected holding times, closed-form solutions

Weaknesses: Assumes Gaussian processes (conflicts with financial data realities)

4. Stochastic Control Approach

Status: Planned

Determines optimal portfolio allocations between pair legs and risk-free assets using Hamilton-Jacobi-Bellmann equations. Key insight: non-delta-neutral positions can be optimal.

Strengths: Theoretically optimal strategy, accounts for divergence risk

Weaknesses: Daily rebalancing creates high transaction costs, limited empirical testing

5. Machine Learning & Other Approaches

Status: Planned

Includes neural networks, genetic algorithms, copulas for complex dependence structures, and PCA to create mean-reverting synthetic portfolios from eigenportfolios.

Krauss identifies combining approaches as a promising direction: cointegration for pair selection, time series for optimal trading rules, and stochastic control for position sizing.

Features

  • Distance Approach (GGR)

    The benchmark method using Sum of Squared Distances

  • Cointegration Approach

    Engle-Granger and Johansen tests for equilibrium relationships

  • Time Series Approach

    Kalman filtering and Ornstein-Uhlenbeck processes

  • Stochastic Control Approach

    Optimal portfolio allocation using Hamilton-Jacobi-Bellmann

  • Machine Learning & Other

    Neural networks, copulas, and PCA-based methods