Appearance
Market Breadth
Family: Flow surveillance
What it computes
Emits MarketBreadthTick ticks carrying pc_ratio, net_delta, advancing, declining off subscribed-universe option trades.
Available on the live, historical, and replay drives.
Methodology
Universe-wide premium-weighted P/C ratio + net-delta proxy + advancing / declining (OMON Composite).
See the methodology overview for the citation index.
Inputs
Subscribed-universe option trades.
Key outputs
Pc_ratio, net_delta, advancing, declining. The full field set is in the tick table below.
Output schema (MarketBreadthTick)
The field / type / description table below is regenerated from the MarketBreadthTick 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 |
|---|---|---|
date | i32 | Trading-session date (YYYYMMDD). |
ts_ms | i32 | Milliseconds since midnight at emission time. |
pc_ratio | f64 | Premium-weighted put/call ratio: Σ(put_prem) / Σ(call_prem). NAN when no call premium; INFINITY when call premium is zero and put premium is positive. |
net_delta | f64 | Net signed-premium balance proxy: Σ(net_call − net_put) over the universe with per-symbol bias +1 / −1 according to which side of the per-symbol differential the symbol sits on. Carries the same magnitude shape the SpotGamma / FlowAlgo net_delta field surfaces. |
advancing | u32 | Symbols whose per-symbol balance is currently > 0. |
declining | u32 | Symbols whose per-symbol balance is currently < 0. |
Configuration (MarketBreadthParams)
Regenerated from the MarketBreadthParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Subscribe by underlying symbol; the engine fans out across the chain and the breadth aggregates per symbol. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
min_emit_interval_ms | i32 | Minimum interval between universe emissions (milliseconds). 1_000 ms = 1Hz by default. |
Example
Python
python
import kairos_thetadata as kt
client = kt.Client.connect(kt.Credentials.from_env())
def on_emission(tick):
print(tick)
sub = client.live().market_breadth([]).for_index("SPX").on_event(on_emission)
sub.wait(timeout_seconds=60.0)TypeScript
typescript
import { Client, Credentials } from "kairos-thetadata";
const client = await Client.connect(Credentials.fromEnv());
await client
.live()
.marketBreadth([])
.forIndex("SPX")
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, MarketBreadthRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.market_breadth(["SPX"])
.on_event(|row: &MarketBreadthRow| println!("pc_ratio={} net_delta={}", row.pc_ratio, row.net_delta))?;
// ... later, to stop delivery ...
sub.unsubscribe();
# Ok(())
# }for_index / for_sector are Python / TypeScript SDK conveniences. On the Rust thin client, pass the constituent universe to the analytic accessor (client.live().<analytic>([...])) — the engine drives the same per-symbol fan-out.