Appearance
Jump Test
Family: Volatility
What it computes
Emits JumpTestTick ticks carrying rv, bv, jump_z, jump_prob off intraday tape (5m bars).
Available on the live, historical, and replay drives.
Methodology
Barndorff-Nielsen / Shephard (2004) RV/BV, Huang-Tauchen (2005) finite-sample guard.
See the methodology overview for the citation index.
Inputs
Intraday tape (5m bars).
Key outputs
Rv, bv, jump_z, jump_prob. The full field set is in the tick table below.
Output schema (JumpTestTick)
The field / type / description table below is regenerated from the JumpTestTick Rust source by docs-site/scripts/inject-doc-tables.ts on every npm run docs:build. Do not hand-edit between the sentinels.
| Field | Type | Description |
|---|---|---|
symbol | Arc<str> | Underlying symbol (interned). |
date | i32 | Trading-session date (YYYYMMDD) at emission time. |
ms_of_day | i32 | Milliseconds since midnight ET at emission time. |
rv_total | f64 | Realized variance over the rolling-window bars RV = Σ rᵢ². Always finite past the first bar — surfaces the cold-start single-bar regime as a finite scalar rather than NaN. |
bv_continuous | f64 | Bipower variation `BV = (π / 2) · Σ |
jump_component | f64 | Jump-component variance J² = max(RV − BV, 0) — the finite-activity jump contribution under the BNS decomposition. Clamped at zero so the institutional invariant BV ≤ RV passes through to the consumer as a hard guarantee. NaN with fewer than two bars (BV is undefined). |
z_statistic | f64 | BNS z-statistic (RV − BV) / sqrt((θ / N) · max(QV, BV²)) with the Huang-Tauchen (2005) denominator-guard. Asymptotically N(0, 1) under the continuous-only null. NaN with fewer than four bars (quad-power kernel undefined) or on a degenerate zero-variance window. |
jump_probability | f64 | Test-confidence gauge Φ(z_statistic) — the standard-normal CDF projection of the z-statistic, in [0, 1]. This is the confidence level at which the one-sided BNS test rejects the no-jump null (1 − p-value), NOT a posterior probability that a jump occurred — the test controls the false-positive rate under the null and says nothing about jump prevalence. Values approaching 1 indicate the per-window RV is statistically dominated by the jump component; values near 0.5 indicate no detectable jump activity. NaN under the documented degenerate-window guard. |
n_intraday_bars | i32 | Count of intraday bars currently inside the rolling window — the BNS N parameter. Values below 4 flag the cold-start regime where the z-statistic stays NaN. |
Configuration (JumpTestParams)
Regenerated from the JumpTestParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stocks only — the analytic silently ignores option / index trades at the on_tick entry point. |
conditions | ConditionPolicy | Trade-condition admission policy applied to every print. |
venues | ExchangeFilter | Exchange / venue admission policy. |
bar_interval_ms | i32 | Per-bar cadence in milliseconds. Defaults to [DEFAULT_BAR_INTERVAL_MS] (300_000 ms / 5 min). |
window_bars | i32 | Rolling-window length in bars. Defaults to [DEFAULT_WINDOW_BARS] (78 — one US-equity session at the default 5-minute cadence). |
min_emit_interval_ms | i32 | Minimum interval between consecutive emissions per symbol, in milliseconds. Defaults to [DEFAULT_MIN_EMIT_INTERVAL_MS] (60_000 ms). Set to 0 to publish on every sealed bar. |
Example
Python
python
import kairos_thetadata as kt
client = kt.Client.connect(kt.Credentials.from_env())
def on_event(row):
print(row)
sub = client.live().jump_test(["QQQ"]).on_event(on_event)
sub.wait(timeout_seconds=60.0)TypeScript
typescript
import { Client, Credentials } from "kairos-thetadata";
const client = await Client.connect(Credentials.fromEnv());
await client
.live()
.jumpTest(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, JumpTestRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.jump_test(["QQQ"])
.on_event(|row: &JumpTestRow| println!("jump_probability={} z_statistic={}", row.jump_probability, row.z_statistic))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }