pairs-trading-lab
glossary

Quick definitions you can scan.

Every term used elsewhere in the Lab, in plain English plus the formula where one exists.

Statistics· 10 terms

Cointegration

Two non-stationary series whose linear combination is stationary.

If are both but , the pair is cointegrated. That stationary spread is what we trade.

ADF test

Tests whether a series has a unit root.

Reject the unit-root null when the t-statistic on in the augmented regression is more negative than the MacKinnon critical value at the chosen level.

Engle-Granger

Two-step cointegration test.

Estimate by OLS, then run an ADF test on the residuals using cointegration-specific MacKinnon CVs.

Walk-forward

Out-of-sample testing methodology.

Fit on training window; record performance on held-out test window; roll forward. The Lab uses rolling estimation as a lighter equivalent.

KPSS test

Tests stationarity directly (opposite null to ADF).

η = T−2 Σ St2 / σ̂2. Critical value 0.463 at 5% (level case). Pair worth trading: ADF rejects AND KPSS fails to reject.

Variance Ratio

Lo-MacKinlay test for departures from a random walk.

VR(q) = Var(q-period sum) / (q · Var(1-period)). VR < 1 ⇒ mean reverting; VR > 1 ⇒ momentum.

Hurst exponent

Slope of log(R/S) vs log(n).

H ≈ 0.5 random walk, H < 0.5 mean reverting, H > 0.5 trending. Tradable pairs typically show H in [0.30, 0.45].

CUSUM

Brown-Durbin-Evans test for parameter stability.

Cumulative recursive residuals; under H0 it's a Brownian motion. Crossing ±a√T means the relationship has shifted.

Johansen test

Multivariate cointegration test.

Trace and max-eigenvalue stats from the rank of Π in the VECM ΔY = ΠY−1 + Σ ΓiΔY−i + ε. Correct generalisation of Engle-Granger to k ≥ 3 variables.

Stationary bootstrap

Politis-Romano resampling with random-length blocks.

Geometric block lengths preserve serial dependence so Sharpe / total-return CIs are honest under autocorrelation.
Modelling· 7 terms

Hedge ratio

The β that defines the spread.

minimises the variance of . Estimated via static OLS, rolling OLS, or a Kalman filter that lets β drift over time.

Z-score

Standardised spread.

Half-life

Time for the spread to close half the gap.

For an OU process with mean reversion speed : . Long half-lives die on transaction costs.

VECM

Vector error-correction model.

Once cointegration is detected, the VECM gives loadings α: how fast each leg adjusts back toward equilibrium. Tells you which leg leads the spread.

Distance method

Gatev-Goetzmann-Rouwenhorst empirical pairs strategy.

Normalise prices, compute SSD over a formation window, trade on ±2σ divergences in the trading window. No β, no ADF, fully empirical.

s-score

Avellaneda-Lee equilibrium standardisation.

s = (X − μOU) / σOU using OU-fitted parameters rather than rolling moments. Trade when |s| ≥ 1.25, close at ≤ 0.5.

Bertram bands

Closed-form OU optimal entry/exit thresholds.

Bertram (2010) maximises (2aσ − cost) / E[T(a)] for an OU spread with fixed cost. The Pair Lab plots the surface.
Risk· 10 terms

Sharpe ratio

Risk-adjusted return per unit of total volatility.

Sortino ratio

Like Sharpe but only penalises downside vol.

Maximum drawdown

Worst peak-to-trough loss in the equity curve.

Calmar ratio

CAGR ÷ max drawdown.

A complementary view to Sharpe: how much CAGR you got per unit of pain.

Risk parity

Each strategy contributes equal risk to total variance.

Solves . Reduces to inverse-vol when strategies are uncorrelated.

VaR / CVaR

α-quantile of return distribution / mean of the tail beyond.

CVaR is the coherent risk measure VaR isn't. The Risk Lab reports both at 95% and 99%.

Ulcer Index

Path-aware drawdown statistic.

√(mean(DDt2)). Captures depth and duration of drawdowns; smoother than max DD.

Pain ratio

Annual return / Ulcer Index.

Smoother Calmar; correlates better with subjective discomfort than the more common single-DD ratios.

Sterling ratio

Annual return / average annual max drawdown.

Average of yearly drawdowns rather than the global max — robust to a single bad year skewing the headline number.

Information ratio

Active-return mean / tracking error.

Goodwin (1998). When benchmark = market, this is the right metric for evaluating sector-neutral pairs against passive long-only.
Execution· 6 terms

Dollar-neutral

Equal long and short dollar exposure.

Simple, but does not hedge market β if the legs have different market exposures.

β-hedged

Net market β ≈ 0.

Size short leg as dollars per dollar long. Dollar exposure may be asymmetric, but the book is market-neutral in expectation.

Amihud illiquidity

Daily price impact per dollar of volume.

Slippage

Difference between expected and realised fill price.

Bigger orders, thinner books, faster moves all increase slippage. The Backtest Studio measures it in bps.

Time stop

Force-close a position after H bars.

If mean reversion has not happened by your model's expected timeline, the relationship has likely shifted; cap the lossy tail.

Capacity

Maximum tradable size before impact eats the edge.

Conservative proxy used in Portfolio: 1% of mean dollar volume on the worse leg. Real-money sizing should use Almgren-Chriss square-root impact.