vike
Indicators

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

IdNameParameters (default; range, step)
ratioPrice Rationone
spreadSpreadlog = 0 (0–1, step 1)
spread_zscoreSpread Z-Scoreperiod = 20 (2–200, step 1); beta = 1 (-5–5, step 0.1)
betaBetaperiod = 5 (2–200, step 1)
correlCorrelationperiod = 30 (2–200, step 1)
correl_logLog-Return Correlationperiod = 30 (2–200, step 1)
half_lifeSpread Half-Lifeperiod = 20 (2–200, step 1); beta = 1 (-5–5, step 0.1)
kalman_betaKalman Hedge Ratiodelta = 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, &params) build an instance; pair_lookback(id, &params) answers how much history both legs must carry before the first value is defined.

On this page