Two-leg rebased relative-value with z-scored ratio + ±σ bands.
Two-leg rebased relative-value with z-scored ratio + ±σ bands.
Both symbols start at 100 at the window's left edge. The chart shows their relative performance over time. Diverging lines = relative-value opportunity (if you believe in mean-reversion).
Bottom strip: log(leg_a / leg_b) z-scored over the rolling window. ±1σ bands. ±2σ = trade entry zone for mean-reverting pairs; ±3σ = extreme; either pair-trade entry or regime break.
Top-right: Engle-Granger cointegration test statistic + p-value. Cointegrated pair = stationary ratio = mean-reverting trade has statistical basis. Not cointegrated = "pair trade" is just two random walks.
Long the cheap leg + short the expensive leg, sized to dollar-neutral. Exit when the z-score returns to the mean (~0). Stop if z extends past 3.5σ — that's regime break, not mean reversion.