Appearance
Circuit Breaker Proximity
Family: Risk
What it computes
Emits CircuitBreakerProximityTick ticks carrying pct_to_L1 / L2 / L3, breach_level off daily-close cache.
Available on the live and replay drives. The historical drive fails closed with KAIROS_ERR_HISTORICAL_UNWIRED until the relevant cache is hydrated externally.
Methodology
NYSE Rule 7.12 / Cboe Rule 6.32 thresholds (-7% / -13% / -20%).
See the methodology overview for the citation index.
Inputs
Daily-close cache.
Key outputs
Pct_to_L1 / L2 / L3, breach_level. The full field set is in the tick table below.
Output schema (CircuitBreakerProximityTick)
The field / type / description table below is regenerated from the CircuitBreakerProximityTick 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 |
|---|---|---|
index_symbol | Arc<str> | Index symbol the thresholds reference (interned). |
date | i32 | Trading session date (YYYYMMDD). |
ms_of_day | i32 | Milliseconds since midnight at emission time. |
last_price | f64 | Last admitted index print. |
reference_price | f64 | Reference price — the prior-session close locked in at session open per NYSE Rule 7.12. |
drawdown_pct | f64 | Cumulative session drawdown vs. reference_price, in percent. Negative once the index trades below the prior close. |
level_1_threshold | f64 | Level 1 threshold in price units (reference × (1 + L1_DRAWDOWN)). |
level_2_threshold | f64 | Level 2 threshold in price units. |
level_3_threshold | f64 | Level 3 threshold in price units. |
pct_to_l1 | f64 | Signed percent distance to Level 1 (relative to last_price). |
pct_to_l2 | f64 | Signed percent distance to Level 2. |
pct_to_l3 | f64 | Signed percent distance to Level 3. |
next_threshold | &'static str | "L1" / "L2" / "L3" / "None" — which level the tape would breach next on continued drawdown. "None" once every MWCB threshold has been breached. |
breach_level | i32 | Deepest level currently breached. 0 when no breach; 1/2/3 for active breaches. |
Configuration (CircuitBreakerProximityParams)
Regenerated from the CircuitBreakerProximityParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Must select the configured index_symbol (default "SPX"); other symbols are silently ignored. |
conditions | ConditionPolicy | Trade-condition admission policy. |
venues | ExchangeFilter | Exchange / venue admission policy. |
daily_close | Arc<DailyCloseCache> | Boot-time hydrated history. Sealed for the lifetime of the subscription. The previous-session close for index_symbol must be present. |
index_symbol | Arc<str> | Symbol of the index the MWCB thresholds reference. Defaults to "SPX" per NYSE Rule 7.12. Operators can override to a proxy ("^GSPC", "SPY") when the canonical cash-index print is unavailable, with the caveat that the published thresholds remain SPX-anchored — a proxy reading is an estimator, not the regulatory truth. |
emit_interval_ms | i32 | Minimum interval between emissions, in milliseconds. Defaults to 1_000 (one snapshot per second). |
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().circuit_breaker_proximity(["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()
.circuitBreakerProximity(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, CircuitBreakerProximityRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.circuit_breaker_proximity(["QQQ"])
.on_event(|row: &CircuitBreakerProximityRow| {
println!("drawdown_pct={} last_price={}", row.drawdown_pct, row.last_price)
})?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }