Algostream_pairs.Mean_reversionMean-reversion signal classifier + half-life estimator.
The classifier is a stateful band crossover over the spread z-score:
Long_spread when z ≤ -entry_z; → Short_spread when z ≥ entry_z; else Hold.Exit when z ≥ -exit_z (target reached) or |z| ≥ stop_z (stop-out); else Hold.Exit when z ≤ exit_z (target reached) or |z| ≥ stop_z (stop-out); else Hold.The half-life estimator runs OLS of Δr_t on r_{t-1} with intercept: φ̂ = 1 + slope; half-life = -ln 2 / ln |φ̂|. Returns `Non_reverting if |φ̂| ≥ 1.
val create : entry_z:float -> exit_z:float -> stop_z:float -> tval position : t -> [ `Flat | `Long | `Short ]val half_life : residuals:float array -> (float, half_life_error) Stdlib.resultval significance : Adf.result -> significanceval signal_to_string : signal -> string