Half-Life Mean Reversion Pass Node
Half-Life Mean Reversion — Series Input
Overview
The Half-Life Mean Reversion Pass Node estimates the half-life of mean reversion for any upstream series: the expected number of bars for a deviation from the mean to halve in magnitude.
A short half-life (e.g. 5 bars) indicates fast mean reversion suitable for high-frequency strategies. A long half-life (e.g. 50 bars) indicates slow reversion, requiring wider hold periods.
Formula
Parameters
| Parameter | Default | Description |
|---|---|---|
| period | 20 | Rolling window in bars for the OLS regression |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any upstream numeric series (spread, residuals) |
| values | Output | (number | null)[] | Half-life in bars per bar; null if not mean-reverting or warm-up |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Hold Period Sizing
Set your mean-reversion trade hold period to approximately 1–2× the half-life for optimal expected return.
Pairs Trade Feasibility
A spread with half-life < 20 bars is tradeable for daily strategies. Half-life > 100 bars indicates the pair may not be reliably mean-reverting.
Dynamic Strategy Adaptation
Monitor rolling half-life to adapt holding periods dynamically as market regimes change.
Tips & Best Practices
Verify Cointegration First
Half-life is only meaningful if the series is cointegrated. Use the Cointegration Pass node as a prerequisite check.
Null Means No Reversion
If the output is null, the regression found λ ≥ 0, meaning the series is trending or random — do not trade as mean-reverting.
Works Best on Spread Series
Apply to a price spread, ratio, or residuals from a regression rather than raw prices for reliable results.