Skip to content

OHLCVC

What it computes

Open / High / Low / Close / Volume / Condition bars on a configurable timeframe (Tick / 1s / 5s / 30s / 1m / 5m / 15m / 1h / 1d). Each bar also carries a condition mask describing whether the bar contains regular RTH prints, late prints, or extended-hours prints — material for execution analytics that filter by venue and condition.

Methodology

The OPRA / UTP condition tables Kairos consumes are sourced from the upstream binary encoding layer and re-exported via crate::wire::conditions. The option side follows the OPRA Pillar Options Trade Conditions specification; the equity side follows UTP Trade Data Feed §3.14.

Inputs

  • TradeTick (option or stock).
  • Per-spec engine trade-condition policy for admission.
  • Per-spec engine exchange-filter policy for venue admission.
  • Per-spec Timeframe.

Output schema (OhlcvcBar)

The field / type / description table below is regenerated from the OhlcvcBar Rust source by docs-site/scripts/inject-doc-tables.ts on every npm run docs:build. Do not hand-edit between the sentinels.

FieldTypeDescription
contractContractResolved contract metadata (symbol, security type, expiration, side, strike). Subscribers identify the security by these fields — the wire-level contract id is engine-internal and is not surfaced here.
timeframeTimeframePeriod of the bar.
bucket_start_msi64Inclusive lower edge of the bucket interval, in ms_of_day.
bucket_end_msi64Exclusive upper edge of the bucket interval, in ms_of_day.
datei32Trading-session date in YYYYMMDD form, sourced from the upstream feed.
openf64Opening trade price of the bar. During the security's regular session — 09:30 ET to its per-symbol close (16:00 ET for an equity option, 16:15 ET for a Cboe index class), resolved from the session calendar — this is the first admitted trade whose primary condition has elig.last; volume-only prints (ODDLOT, AVGPRC, …) leave the bar unanchored until a last-eligible trade in the same bar anchors it. In pre-market and after-hours the SIP last-sale gate is dropped and the first qualifying trade anchors open regardless of elig.last. Bars publish only once a price-eligible trade anchors the frame, so open is always finite on emitted bars.
highf64Highest trade price observed in the bar. Finite on every emitted bar — unanchored bars are not published.
lowf64Lowest trade price observed in the bar. Finite on every emitted bar — unanchored bars are not published.
closef64Most recent trade price applied to the bar.
volumei64Total volume aggregated across volume-eligible trades in the bar.
counti64Total count of admitted trades in the bar.
vwapf64Volume-weighted average price across volume-eligible trades; NaN while volume is zero.
first_seqi32Wire sequence of the first admitted trade in the bar.
last_seqi32Wire sequence of the most recently admitted trade in the bar.
seq_gap_observedbooltrue if a non-unit gap was observed between consecutive admitted sequence values.
closedbooltrue once the window has crossed its boundary and will not receive further updates; false for in-progress snapshots emitted under EmitPolicy.
flagsBarFlagsBar-level annotations carried over from the trades that contributed.

Configuration (OhlcvcRequest)

Regenerated from the OhlcvcRequest Rust source — see the note above.

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks; evaluated once per (filter_id, contract_id) pair on first observation.
timeframeTimeframeBar period.
emitEmitPolicyWhether bars emit only on close or on every qualifying trade.
conditionsConditionPolicyTrade-condition admission policy.
venuesExchangeFilterExchange / venue admission policy. Default [ExchangeFilter::Any] matches the SIP-consolidated tape ThetaData hosted bars are computed against. Use [ExchangeFilter::Only] / [ExchangeFilter::Allow] to build per-venue OHLC series (e.g. Nasdaq-only QQQ bars), or [ExchangeFilter::Reject] to exclude specific venues such as the FINRA TRFs. The same OHLCVC methodology (cancel handling, asterisk-condition demotion, RTH vs extended-hours close rule, out-of-sequence HLC skip, first-trade open anchor) runs on whichever subset of trades the filter admits.

Operational characteristics

  • Per-tick latency. O(1) update; bar boundaries computed by integer bucketing on ms_of_day.
  • Allocation discipline. Open-bar state is a single struct on the per-contract cell; no hot-path allocations.
  • Replay parity. Deterministic — bucket boundaries are wire-derived.

Example

rust
// Cargo.toml:
//   kairos = "0.1"

use kairos::{Client, OhlcvcRow};

let client = Client::connect(("me@example.com", "secret"))?;

let sub = client
    .live()
    .ohlcvc(["QQQ"])
    .on_event(|row: &OhlcvcRow| println!("open={} close={} volume={}", row.open, row.close, row.volume))?;

// ... later, to stop delivery ...
sub.unsubscribe();

Proprietary. All rights reserved.