Appearance
Amihud Illiquidity
Family: Microstructure
What it computes
Emits AmihudIlliquidityTick ticks carrying / dollar_volume_tover the trailinglookback_sessions` daily-close history — Acharya / Pedersen (2005) §IV cross-sectional liquidity-cost regressor off r_t.
Drive availability: daily-close cache.
Methodology
Amihud (2002) illiquidity ratio `ILLIQ = (1/T) · Σ.
See the methodology overview for the citation index.
Inputs
R_t.
Key outputs
/ dollar_volume_tover the trailinglookback_sessions` daily-close history — Acharya / Pedersen (2005) §IV cross-sectional liquidity-cost regressor. The full field set is in the tick table below.
Output schema (AmihudIlliquidityTick)
The field / type / description table below is regenerated from the AmihudIlliquidityTick 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. For watermark-driven snapshots this is the watermark date; for the first intraday snapshot it is the trade date. |
illiq_ratio | f64 | Amihud (2002) illiquidity ratio: `(1/T) · Σ |
illiq_x_1e6 | f64 | illiq_ratio · 1e6 — the conventional decimal-range Amihud- replication research papers print. NaN mirrors illiq_ratio. |
sessions_used | i32 | Count of sessions whose ` |
lookback_available | i32 | Total log-return sessions available in the cache for this symbol — max(0, history.len() - 1). Surfaces the upper bound against which sessions_used reports. |
Configuration (AmihudIlliquidityParams)
Regenerated from the AmihudIlliquidityParams Rust source — see the note above.
| Field | Type | Description |
|---|---|---|
contracts | SecurityFilter | Contracts the subscription tracks. Stock-only — the analytic silently ignores option / index trades at the on_tick entry point. |
conditions | ConditionPolicy | Trade-condition admission policy applied to the live trade-tape trigger that drives intraday session-rollover emissions; the same policy gates trade prints on related analytics so the filtered universe is consistent. |
venues | ExchangeFilter | Exchange / venue admission policy. |
daily_close | Arc<DailyCloseCache> | Boot-time hydrated daily-close history. Sealed for the lifetime of the subscription. Holds the per-session (close, volume) pair the Amihud kernel consumes. |
lookback_sessions | i32 | Rolling-window length in trading sessions. Defaults to [DEFAULT_LOOKBACK_SESSIONS] (21 sessions / one month). |
min_sessions | i32 | Minimum admitted sessions for the rolling window to emit a real-valued ratio. Defaults to [DEFAULT_MIN_SESSIONS] (5). |
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().amihud_illiquidity(["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()
.amihudIlliquidity(["QQQ"])
.onEvent((tick) => {
console.log(tick);
});Rust
rust
// Cargo.toml:
// kairos = "0.1"
use kairos::{Client, AmihudIlliquidityRow};
# fn run() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::connect(("me@example.com", "secret"))?;
let sub = client
.live()
.amihud_illiquidity(["QQQ"])
.on_event(|row: &AmihudIlliquidityRow| {
println!("illiq_ratio={} sessions_used={}", row.illiq_ratio, row.sessions_used)
})?;
// ... later ...
sub.unsubscribe();
# Ok(())
# }