Pair indicators
The 8 two-series indicators — spread and benchmark kernels behind their own seam — with every parameter and default, rendered from the pair registry.
A pair indicator reads TWO series — an instrument and its benchmark, or the two legs of a spread —
where every indicator in the main catalog reads one. They live behind their
own seam (vike_indicators::pairs::PairIndicator, with pair_registry as their roster) because
the second input changes the whole streaming contract: a pair value is defined only where both
series have a bar, and the lookback a kernel needs is a function of both. Vike Trader ships
8 of them beside its 171 single-series indicators.
They carry the same guarantee as the single-series catalog — streaming equals batch, bit-for-bit,
under their own parity gate (crates/vike-indicators/tests/pairs_parity.rs) — and the same
parameter surface: a name, a default, and the range and step the Studio's sweep grid offers.
Pair indicators
| Id | Name | Parameters (default; range, step) |
|---|---|---|
ratio | Price Ratio | none |
spread | Spread | log = 0 (0–1, step 1) |
spread_zscore | Spread Z-Score | period = 20 (2–200, step 1); beta = 1 (-5–5, step 0.1) |
beta | Beta | period = 5 (2–200, step 1) |
correl | Correlation | period = 30 (2–200, step 1) |
correl_log | Log-Return Correlation | period = 30 (2–200, step 1) |
half_life | Spread Half-Life | period = 20 (2–200, step 1); beta = 1 (-5–5, step 0.1) |
kalman_beta | Kalman Hedge Ratio | delta = 0.0001 (0.000001–0.1, step 0.0001); ve = 0.001 (0.000001–1, step 0.001) |
Using them
A pair indicator needs its benchmark named: in a Rhai strategy
the second series is declared beside the first, and the pairs z-score
template is the reference consumer — it trades the rolling z-score of a spread using exactly this
seam. From Rust, vike_indicators::pair_make(id) and pair_make_with(id, ¶ms) build an
instance; pair_lookback(id, ¶ms) answers how much history both legs must carry before the
first value is defined.