Appearance
Odd Lot Ratio
Family: Microstructure
What it computes
Emits OddLotRatioTick ticks carrying oddlot_count, oddlot_volume, oddlot_ratio, total_count off stock trade tape.
Available on the live, historical, and replay drives.
Methodology
O'Hara / Yao / Ye (2014) §IV odd-lot fraction oddlot_count / total_count over a rolling window — informed-retail order-flow proxy under the NYSE Rule 55 / NASDAQ Rule 4756 100-share round-lot threshold.
See the methodology overview for the citation index.
Inputs
Stock trade tape.
Key outputs
Oddlot_count, oddlot_volume, oddlot_ratio, total_count. The full field set is in the tick table below.
Output schema (OddLotRatioTick)
The field / type / description table below is regenerated from the OddLotRatioTick 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. |
oddlot_count | i32 | Count of admitted prints whose size is strictly less than round_lot inside the rolling window. |
oddlot_volume | i64 | Σ size of those prints inside the rolling window — the odd-lot share volume. |
oddlot_ratio | f64 | Odd-lot fraction: oddlot_count / total_count. NaN when the window admits zero prints (cold-start data quality). |
total_count | i32 | Total admitted prints inside the rolling window — the denominator the ratio is computed against. |
Configuration (OddLotRatioParams)
Regenerated from the OddLotRatioParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stock-only. |
conditions | ConditionPolicy | Trade-condition admission policy applied to every print. |
venues | ExchangeFilter | Exchange / venue admission policy. |
round_lot | i32 | Round-lot threshold in shares — prints whose size is strictly less than this value are counted as odd lots. Defaults to [DEFAULT_ROUND_LOT] (100 shares). Override only if the underlying market's round-lot convention differs (some Asian markets quote in 1_000-share board lots). |
window_ms | i32 | Rolling-window length in milliseconds. Defaults to [DEFAULT_WINDOW_MS] (60_000 ms / one minute). |
min_emit_interval_ms | i32 | Minimum 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().odd_lot_ratio(["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()
.oddLotRatio(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, OddLotRatioRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.odd_lot_ratio(["QQQ"])
.on_event(|row: &OddLotRatioRow| println!("oddlot_ratio={} oddlot_volume={}", row.oddlot_ratio, row.oddlot_volume))?;
// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }