Half-Life Mean Reversion Pass Node

Half-Life Mean Reversion — Series Input

StatisticalMean ReversionPass

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

Ornstein-Uhlenbeck mean-reversion speed:
Δx[t] = λ × x[t-1] + ε (OLS regression)
halfLife = −log(2) / log(1 + λ)
λ must be negative for mean reversion. If λ ≥ 0, the series is not mean-reverting and halfLife = null.

Parameters

ParameterDefaultDescription
period20Rolling window in bars for the OLS regression

Inputs & Outputs

SlotDirectionTypeDescription
inputInput{ values, timestamps }Any upstream numeric series (spread, residuals)
valuesOutput(number | null)[]Half-life in bars per bar; null if not mean-reverting or warm-up
timestampsOutputnumber[]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.

Related Indicators