Skip to content

Quote Intensity

Family: Microstructure

What it computes

Emits QuoteIntensityTick ticks carrying quote_rate, cancel_rate, trade_rate, quote_events_in_window, trade_events_in_window off stock NBBO quote tape + trade tape.

Available on the live, historical, and replay drives.

Methodology

Hendershott / Riordan (2013) §III.B HFT-activity proxy — admitted quote / trade event-rate over a rolling window with implied cancel_rate = max(0, quote_rate − trade_rate) from the matched-print residual.

See the methodology overview for the citation index.

Inputs

Stock NBBO quote tape + trade tape.

Key outputs

Quote_rate, cancel_rate, trade_rate, quote_events_in_window, trade_events_in_window. The full field set is in the tick table below.

Output schema (QuoteIntensityTick)

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

FieldTypeDescription
symbolArc<str>Underlying symbol (interned).
datei32Trading-session date (YYYYMMDD).
ms_of_dayi32Milliseconds since midnight at emission time.
quote_ratef64Admitted NBBO updates per second over the rolling window.
cancel_ratef64Implied cancellation cadence per second over the rolling window: max(0, quote_rate − trade_rate) per the Hendershott-Riordan proxy convention.
trade_ratef64Admitted trade prints per second over the rolling window.
quote_events_in_windowi32Number of admitted NBBO updates currently inside the window.
trade_events_in_windowi32Number of admitted trade prints currently inside the window.

Configuration (QuoteIntensityParams)

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

FieldTypeDescription
contractsSecurityFilterContracts the subscription tracks. Stock-only — both quote and trade streams must resolve to the same per-symbol cell.
conditionsConditionPolicyTrade-condition admission policy applied to every NBBO update + every trade print; same policy gates both axes so the quote / trade decomposition is consistent.
venuesExchangeFilterExchange / venue admission policy.
window_msi32Rolling-window length in milliseconds. Defaults to [DEFAULT_WINDOW_MS] (1_000 ms).
min_emit_interval_msi32Minimum interval between consecutive emissions per symbol, in milliseconds. Defaults to [DEFAULT_MIN_EMIT_INTERVAL_MS] (1_000 ms). Set to 0 to surface every admission.

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().quote_intensity(["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()
  .quoteIntensity(["QQQ"])
  .onEvent((tick) => {
    console.log(tick);
  });

Rust

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

use kairos::{Client, QuoteIntensityRow};

# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;

let sub = client
    .live()
    .quote_intensity(["QQQ"])
    .on_event(|row: &QuoteIntensityRow| println!("quote_rate={} trade_rate={}", row.quote_rate, row.trade_rate))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }

Proprietary. All rights reserved.