Cointegration Test Calculator

RISK/STATS · COINTEGRATION · ADVANCED

Engle-Granger two-step cointegration test for a pair of price series: the standard pairs-trading signal, with the hedge ratio from the cointegrating regression.

30 values

Comma, space, or newline separated. No thousand separators (write 43250.50, not 43,250.50).

30 values

Comma, space, or newline separated. No thousand separators (write 43250.50, not 43,250.50).

Engle-Granger two-step test: OLS regression Y = alpha + beta*X, then an Augmented Dickey-Fuller test on the residuals. A significantly negative t-statistic (below the critical value) means the residual spread is stationary: Y and X are cointegrated.

Enter two equal-length price series (≥20 values each)

The formula

Engle-Granger two-step procedure:

  • Step 1: OLS regression Y = α + βX, giving the hedge ratio β
  • Step 2: ADF test on the residuals: delta(e_t) = gamma × e_(t-1) + u_t
  • t-stat = γ / SE(γ), compared against critical values at 1%/5%/10%

Reading the result

A t-statistic more negative than the critical value rejects the unit-root null: the residual spread is stationary, meaning Y and X are cointegrated at that significance level. The hedge ratio (β) is how many units of X to hold per unit of Y to build the spread.

Where to go next

Cointegration is a relationship between two series. For memory structure within a single series, see the Hurst exponent calculator, or size a position against tail risk with the VaR / CVaR calculator.

Use via API or MCP

This calculation is available as a deterministic API call for bots and AI agents.

FAQ
Q.01

What does "cointegrated" mean for a pair of assets?

Two price series are cointegrated if a specific linear combination of them is stationary (mean-reverting) even though each series individually is not (each may wander like a random walk). This is the statistical basis for pairs trading: if the spread reverts to its mean, deviations from that mean are a tradeable signal.

Q.02

How does the Engle-Granger test work?

Two steps: (1) an OLS regression of one price series on the other, Y = alpha + beta*X, giving the hedge ratio beta; (2) an Augmented Dickey-Fuller test on that regression's residuals, testing whether the residual spread has a unit root (non-stationary, not cointegrated) or is stationary (cointegrated).

Q.03

What does the hedge ratio (beta) mean in practice?

It's how many units of X to hold per unit of Y to construct the cointegrating spread (Y - beta*X). A pairs trade typically goes long the undervalued side and short beta units of the other when the spread deviates from its historical mean.

Q.04

Why are the critical values different from a standard ADF test?

Testing the RESIDUALS of a prior regression (rather than testing a raw series directly) changes the test statistic's distribution: these are the MacKinnon critical values specific to the two-step Engle-Granger procedure, not the plain Dickey-Fuller table.

Q.05

Correlation vs cointegration: aren't these the same thing?

No. Two series can be highly correlated in their day-to-day moves while drifting apart over the long run (not cointegrated), and two series can be weakly correlated day-to-day while still sharing a stable long-run relationship (cointegrated). Pairs trading specifically needs cointegration, not just correlation.