Cointegration Pass Node
Cointegration Score — Series Input
Overview
The Cointegration Pass Node measures the mean-reverting strength of any upstream numeric series over a rolling window. Inspired by the Engle-Granger cointegration test, it produces a score indicating how strongly the series tends to revert to an equilibrium.
Use it to validate that a spread or ratio series is truly cointegrated before applying mean-reversion strategies.
Formula
Parameters
| Parameter | Default | Description |
|---|---|---|
| period | 20 | Rolling window in bars for cointegration scoring |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any upstream numeric series (spread, ratio, price) |
| values | Output | (number | null)[] | Cointegration score per bar; nulls during warm-up |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Pairs Trading Spread Validation
Confirm the spread between two assets is cointegrated before entering a pairs trade. High score = safe to trade.
Regime Detection
Monitor cointegration score over time to detect when a previously reliable mean-reverting relationship breaks down.
Mean Reversion Confirmation
Use as a gating condition for mean-reversion entries: only trade when cointegration score exceeds a threshold.
Tips & Best Practices
Combine with Half-Life
A cointegrated spread with short half-life (e.g. < 10 bars) offers both the statistical basis and speed needed for profitable mean reversion.
Works Best on Spreads
Most effective when the input is a price spread or ratio between two correlated assets, not raw prices.
Dynamic Monitoring
Cointegration can break down. Monitor the rolling score and exit positions when it drops below your threshold.