Cointegration Test
workflow.run_cointegrationEngle-Granger two-step cointegration test for a pair of price series: do they share a long-run equilibrium relationship (their spread is stationary/mean-reverting)? The standard pairs-trading signal test. Returns the cointegrating regression's hedge ratio (beta) and an ADF t-statistic on the residuals, compared against 1%/5%/10% critical values. Use when user asks "are these two assets cointegrated?" or "is this a valid pairs trade?". Returns: alpha, beta (hedge ratio), t_stat, critical_values, cointegrated (booleans at each significance level).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Second price series, same length and dates as y | |
| y | Yes | First price series (the dependent variable in the cointegrating regression) |