Appearance
PriceBand52W
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
Rolling 252-trading-day high / low per symbol, plus newhigh / newlow flags fired by live trades. The analytic rolls up (low_52w, high_52w) once at subscription time from engine daily-close cache::last_n(symbol, 252), then fires one tick on every admitted stock trade whose price crosses either extreme. Session rollover re-emits the latest band snapshot.
Methodology
Rolling extrema over the configured window. The 52w glossary suffix on the output fields is the trade-alert.com glossary term, not a declaration of the underlying lookback — window_days is configurable, but the field names retain the conventional suffix.
Methodology parity with Bloomberg 52WkHi / 52WkLo, Refinitiv HIGH_52W / LOW_52W, and trade-alert.com newhigh / newlow.
Inputs
- engine daily-close cache at boot.
- Stock
TradeTickfor intraday crossings.
Output schema (PriceBand52WTick)
The field / type / description table below is regenerated from the PriceBand52WTick 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 | Session date the triggering trade printed in (YYYYMMDD). |
ms_of_day | i64 | Trade time the triggering print landed at, in ms since midnight ET. For watermark-driven snapshots, the watermark's ms_of_day. |
price | f64 | Trade price that fired the emission. NaN for watermark-driven snapshots. |
low_52w | f64 | Lowest close observed across the trailing [ROLLING_WINDOW_DAYS] sessions cached at subscription time. |
high_52w | f64 | Highest close observed across the trailing [ROLLING_WINDOW_DAYS] sessions cached at subscription time. |
newhigh | bool | true when the triggering trade printed strictly above [Self::high_52w]. |
newlow | bool | true when the triggering trade printed strictly below [Self::low_52w]. |
Configuration (PriceBand52WRequest)
Construct via PriceBand52WParams::new(filter, daily_close) — the [the analytic's default-spec helper] impl returns this same constructor wired with the engine's hydrated cache.
Regenerated from the PriceBand52WRequest Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stocks only. |
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. |
window_days | usize | Rolling window length in trading days. 252 = 52 weeks (default — matches the field-name suffix); 21 = 1 month; 63 = 1 quarter; 1300 = 5 years. Tick field names retain the 52w suffix per industry glossary terminology even when the configured window deviates from 252 — the suffix is the trade-alert glossary term, not a declaration of the underlying lookback. |
Operational characteristics
- Per-tick latency. O(1) — two comparisons per print.
- Allocation discipline. Band snapshot is a single struct on the per-symbol cell; no hot-path allocations.
- Replay parity. Deterministic given identical daily-close cache state.
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.