Appearance
StockFlow
Preview on the public Rust client. The analytic ships in the engine and is reachable today through the Python wheel and the TypeScript / Node addon; a per-analytic builder on the public Rust thin client (
kairos::Client) is tracked on the roadmap. The output tick schema below is stable.
What it computes
Stock-side counterpart of OptionFlow: per-bucket buy / sell / mid volume plus dollar value with side classification. Stocks have no contract multiplier; the per-trade dollar value is price × size.
Methodology
Lee & Ready (1991), as documented at /methodology/lee-ready.
Inputs
- Stock
TradeTick. - The pre-trade NBBO snapshot for the same symbol.
Output schema (StockFlowTick)
Mirrors OptionFlowTick; stock dollar value is reported in the buy_value / sell_value / mid_value columns (price × size, no contract multiplier). The field / type / description table below is regenerated from the StockFlowTick 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 |
|---|---|---|
contract | Contract | Resolved contract metadata. Subscribers identify the security by (symbol, expiration, right, strike) on this field — the wire-level contract id is engine-internal and is not surfaced here. |
date | i32 | Trading-session date in YYYYMMDD form. |
timeframe | Timeframe | Bucket period this snapshot covers. |
bucket_start_ms | i64 | Inclusive start of the bucket in milliseconds since midnight. |
bucket_end_ms | i64 | Exclusive end of the bucket in milliseconds since midnight. |
closed | bool | true if the bucket is closed; false for an intra-bucket partial snapshot. |
count | u32 | Total trade count in the bucket. |
total_volume | u64 | Total volume in the bucket (shares). |
total_value | f64 | Total dollar value in the bucket (USD). |
buy_volume | u64 | Buyer-initiated volume (shares). |
sell_volume | u64 | Seller-initiated volume (shares). |
mid_volume | u64 | Mid-classified volume (shares). |
buy_value | f64 | Buyer-initiated dollar value (USD). |
sell_value | f64 | Seller-initiated dollar value (USD). |
mid_value | f64 | Mid-classified dollar value (USD). |
net_flow | f64 | Net flow: buy_value − sell_value. |
tick_rule_resolved_buys | u32 | At-mid prints resolved by the tick-rule fallback to buy. |
tick_rule_resolved_sells | u32 | At-mid prints resolved by the tick-rule fallback to sell. |
tick_rule_unresolved | u32 | At-mid prints that fell through to the tick-rule fallback and could not be resolved (no prior different price). Stays in mid_* totals. |
Configuration (StockFlowRequest)
Regenerated from the StockFlowRequest Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stocks only — the analytic ignores option / index / rate ticks via the [thetadatadx::SecType] gate on the dispatch path. Typically a [SecurityFilter::Symbols] entry naming the equity tickers. |
timeframe | Timeframe | Bucket period. Defaults to [Timeframe::S1] (one-second buckets), the canonical intraday flow cadence. |
emit | EmitPolicy | Whether the analytic emits one tick per closed bucket ([EmitPolicy::OnClose]) or after every admitted trade ([EmitPolicy::OnEveryTick]). |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
classification | SideClassification | Side-classification policy applied to every admitted trade. |
reference_quote_label | QuoteLabel | Quote-cycle position cached as the Lee-Ready reference NBBO. Defaults to [QuoteLabel::PreTrade] per Lee & Ready (1991) §II.B. |
Operational characteristics
Same shape as OptionFlow: O(1) per-tick update, Neumaier-summed running totals, replay-deterministic.
Example
Preview. This analytic ships in the engine and is reachable today through the Python wheel and the TypeScript / Node addon. A per-analytic builder on the public Rust thin client (
kairos::Client) is tracked on the roadmap — bare-string symbol filters passed to the analytic accessor will match the other analytics already exposed there. The output tick rows are stable and documented above.