Appearance
Hurst Exponent
Family: Stat-arb
What it computes
Emits HurstExponentTick ticks carrying hurst, rescaled_range, range, stddev, n_intraday_bars off stock trade tape (5m bars).
Available on the live, historical, and replay drives.
Methodology
Mandelbrot-Wallis (1969) rescaled-range R/S with the Anis-Lloyd (1976) centered estimator H = ½ + (ln(R/S) − ln E₀[R/S_N])/ln(N) and the Weron (2002) finite-sample factor, over rolling per-bar log returns.
See the methodology overview for the citation index.
Inputs
Stock trade tape (5m bars).
Key outputs
Hurst, rescaled_range, range, stddev, n_intraday_bars. The full field set is in the tick table below.
Output schema (HurstExponentTick)
The field / type / description table below is regenerated from the HurstExponentTick 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) at emission time. |
ms_of_day | i32 | Milliseconds since midnight ET at emission time. |
hurst | f64 | Anis-Lloyd-centred rescaled-range Hurst exponent H = ½ + (ln(R/S) − ln E₀[R/S_N]) / ln(N). H > 0.5 flags the trending regime; H < 0.5 flags the mean-reverting regime; H ≈ 0.5 flags the geometric Brownian null. |
rescaled_range | f64 | Rescaled range R / S — the unstandardised statistic the scaling law is fit against. |
range | f64 | Range R = max(y_t) − min(y_t) of the cumulative deviation from the sample mean. |
stddev | f64 | Sample standard deviation S = sqrt((1 / N) · Σ (r_i − μ)²) of the per-bar log returns over the window. |
n_intraday_bars | i32 | Count of intraday bars currently inside the rolling window. |
Configuration (HurstExponentParams)
Regenerated from the HurstExponentParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stocks only. |
conditions | ConditionPolicy | Trade-condition admission policy applied to every print. |
venues | ExchangeFilter | Exchange / venue admission policy. |
bar_interval_ms | i32 | Per-bar cadence in milliseconds. Defaults to [DEFAULT_BAR_INTERVAL_MS] (300_000 ms / 5 min). |
window_bars | i32 | Rolling-window length in bars. Defaults to [DEFAULT_WINDOW_BARS] (78 — one US-equity session). |
min_emit_interval_ms | i32 | Minimum interval between consecutive emissions per symbol, in milliseconds. Defaults to [DEFAULT_MIN_EMIT_INTERVAL_MS] (60_000 ms). |
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().hurst_exponent(["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()
.hurstExponent(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, HurstExponentRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.hurst_exponent(["QQQ"])
.on_event(|row: &HurstExponentRow| println!("hurst={}", row.hurst))?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }