Appearance
Opening Auction Imbalance
Family: Flow surveillance
What it computes
Emits OpeningAuctionImbalanceTick ticks carrying window_start_ms, window_end_ms, buy_volume, sell_volume, total_volume, imbalance, n_prints off stock trade tape.
Available on the live, historical, and replay drives.
Methodology
Lee-Ready (1991) signed-volume imbalance (buy_volume − sell_volume) / total_volume over the post-open auction window.
See the methodology overview for the citation index.
Inputs
Stock trade tape.
Key outputs
Window_start_ms, window_end_ms, buy_volume, sell_volume, total_volume, imbalance, n_prints. The full field set is in the tick table below.
Output schema (OpeningAuctionImbalanceTick)
The field / type / description table below is regenerated from the OpeningAuctionImbalanceTick 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). |
ms_of_day | i32 | Milliseconds since midnight at emission time — the first post-window admission timestamp that triggered the seal. |
window_start_ms | i32 | Window-start boundary (ms-of-day). |
window_end_ms | i32 | Window-close boundary (ms-of-day) — window_start_ms + window_ms. |
buy_volume | i64 | Buyer-initiated share volume over the window. |
sell_volume | i64 | Seller-initiated share volume over the window. |
total_volume | i64 | Total classified share volume over the window — buy_volume + sell_volume. Indeterminate (zero-tick / first print) volume is excluded. |
imbalance | f64 | Signed-flow imbalance ratio (buy_volume − sell_volume) / total_volume. NaN when total_volume == 0. |
n_prints | i32 | Number of classified prints contributing to the imbalance. |
Configuration (OpeningAuctionImbalanceParams)
Regenerated from the OpeningAuctionImbalanceParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stock-only — the analytic silently ignores option / index trades at the on_tick entry point. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
window_ms | i32 | Length of the opening auction window in milliseconds. Defaults to [DEFAULT_WINDOW_MS] (300_000 ms — five minutes). |
session_open_ms_of_day | i32 | Session-open boundary in milliseconds-of-day. Defaults to [DEFAULT_SESSION_OPEN_MS] (34_200_000 — 09:30:00 ET). |
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().opening_auction_imbalance(["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()
.openingAuctionImbalance(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, OpeningAuctionImbalanceRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.opening_auction_imbalance(["QQQ"])
.on_event(|row: &OpeningAuctionImbalanceRow| println!("buy_volume={}", row.buy_volume))?;
// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }