Frankline Oyolo, Misango

Published on

Statistical Arbitrage Through Pairs Trading: A Practical Demonstration

Abstract

This paper introduces a novel pairs trading framework combining fractional cointegration, stochastic optimal control, and reinforcement learning applied to BTC/ETH. We extend traditional cointegration theory to capture long-memory dependencies and formalize trading decisions via Hamilton-Jacobi-Bellman equations. Key innovations include volatility-adaptive thresholding with Gaussian Process optimization, fractional Ornstein-Uhlenbeck dynamics for spread modeling, and a deep RL agent for real-time parameter tuning. Backtests show 35% higher risk-adjusted returns versus benchmarks with 38% lower drawdowns.

Introduction

Pairs trading exploits the mean-reverting behavior of asset price spreads. The core mathematical foundation is the cointegration of two time series, ensuring a stationary linear combination exists: . Traditional pairs trading faces three fundamental limitations: standard cointegration assumes integer-order integration $I(1)$, static thresholds ignore volatility regimes, and mean-reversion models miss long-range dependence. This framework solves all three.

Motivation

Cryptocurrency pairs offer a compelling statistical arbitrage opportunity: BTC and ETH share common economic drivers (crypto market sentiment, regulatory news, liquidity cycles) yet diverge temporarily due to idiosyncratic factors. The Johansen trace test confirms cointegration rank $r=1$ for BTC/ETH (trace statistic 48.72 vs critical value 35.17 at 95%), validating the pair. The motivation for fractional extensions is that standard $I(1)$ cointegration misses the long-memory structure in crypto spreads, leading to suboptimal threshold placement and excessive trading.

Key Equations

Hedge ratio via OLS:

Fractional cointegration (Geweke-Porter-Hudak estimator for $d$):

Ornstein-Uhlenbeck spread dynamics:

Z-score and rolling estimators:

Volatility-adaptive threshold:

HJB stochastic control formulation:

RL Q-learning update:

Algorithm Blueprint

Fractional Pairs Trading — BTC/ETH

Inputs: Price series ,

Outputs: Trade signals, position vectors, cumulative P&L

Algorithm:

  1. COINTEGRATION TEST & PARAMETER ESTIMATION (252-day formation window)

    • Run Johansen trace test on
    • Accept pair if trace statistic $> 35.17$ (95% critical value)
    • Estimate hedge ratio: (OLS)
    • Estimate fractional integration order $d$ via Geweke-Porter-Hudak estimator
    • Compute mean-reversion half-life: from OU regression
  2. SPREAD & Z-SCORE CALCULATION

    • Spread:
    • Z-score (rolling 60-day):
    • where and
  3. ADAPTIVE THRESHOLD & VOLATILITY ADJUSTMENT

    • EWMA spread volatility:
    • Logistic threshold:
    • Optimal hyperparameters: achieves Sharpe = 3.27
  4. SIGNAL GENERATION & EXIT RULES

    • If : SHORT BTC, LONG ETH (spread too wide, mean reversion trade)
    • If : LONG BTC, SHORT ETH (spread too narrow, mean reversion trade)
    • If $|z[t]| < 0.5$ AND position open: EXIT all positions (mean reversion complete)
  5. KALMAN FILTER (real-time hedge ratio adaptation)

    • State transition: (constant hedge ratio model)
    • Measurement:
    • Kalman gain:
    • Update:
    • Covariance:
  6. REINFORCEMENT LEARNING AGENT (policy parameter tuning)

    • State:
    • Action space:
    • Policy:
    • Update via REINFORCE:

Results

Sharpe Ratio Progression — Model Variants (BTC/ETH, 2020–2024)

Max Drawdown by Model Variant

| Model | Sharpe | Calmar | Max DD | Profit Factor | CAPM α | |---|---|---|---|---|---| | Standard OU | 1.82 | 2.15 | 8.7% | 1.92 | 0.08 | | Johansen VAR | 2.03 | 2.47 | 7.9% | 2.15 | 0.12 | | Our Framework | 2.86 | 3.42 | 5.4% | 3.15 | 0.21 | | + Fractional CI | 3.11 | 3.78 | 4.9% | 3.42 | 0.24 | | + RL Control | 3.27 | 4.01 | 4.3% | 3.68 | 0.29 |

Backtest period: Jan 2020 – Dec 2024 on BTC/ETH cryptocurrency pair.

Contributions

  • First application of fractional cointegration to cryptocurrency pairs trading, capturing long-memory spread dynamics missed by standard $I(1)$ models
  • Stochastic control formulation via HJB equations providing theoretically grounded entry/exit decisions
  • Volatility-adaptive thresholds via Gaussian Process regression, eliminating the need for static threshold tuning
  • Convergence proof for the RL-based trading agent and high-frequency P&L decomposition theorem including Hawkes jump processes

Paper

Author

Frankline Misango Oyolo Quantitative Research Division, Arithmax Research research@arithmax.com — Published: October 19, 2025