Market microstructure#
Order flow and liquidity from trades and quotes: trade signing, imbalance, price impact, and arrival intensity.
Trade signing#
Classify each trade as buyer- or seller-initiated to recover signed order flow.
Function |
Description |
|---|---|
Buy-initiated share of a bar's volume estimated as the normal CDF of return / trailing-window volatility. |
|
Trade sign by the Lee-Ready (1991) rule: quote test with tick-rule fallback. |
|
Aggressor-signed volume, sign * volume. |
|
Trade sign by the tick rule (+1 up-tick, -1 down-tick, carry on unchanged). |
Order-flow imbalance#
Net buying pressure and its toxicity: trade-flow imbalance, book imbalance, and VPIN.
Function |
Description |
|---|---|
Cont-Kukanov-Stoikov (2014) order-flow imbalance from L1 book events. |
|
Normalized signed order flow, (buy - sell) / (buy + sell). |
|
Normalized L1 book imbalance, (bid_size - ask_size) / (bid_size + ask_size). |
|
Trailing-window sum of signed order flow (Chordia-Roll-Subrahmanyam imbalance). |
|
Volume-synchronized probability of informed trading (Easley-Lopez de Prado-O'Hara 2012): order-flow toxicity. |
Price impact & liquidity#
How far order flow moves price and what trading costs: Kyle's lambda, Amihud, Roll spread, the propagator, and the micro-price.
Function |
Description |
|---|---|
Rolling mean of |return| / notional (Amihud 2002 illiquidity ratio). |
|
Effective spread, 2*|price - mid|: the round-trip cost paid relative to the mid. |
|
Exponentially-weighted price-impact slope of return on signed order flow. |
|
Imbalance-weighted mid (Stoikov 2018, first-order): fair value that leans toward the thinner side of the book. |
|
Bouchaud (2004) propagator model: price impact as a decaying-kernel convolution over past signed order flow. |
|
Realized spread, 2*D*(price - mid a few steps later): the liquidity part of the effective spread. |
|
Rolling-window price-impact slope of return on signed order flow (Kyle 1985). |
|
Roll (1984) effective spread from trade prices alone: 2*sqrt(-cov(dP_t, dP_{t-1})) over a trailing window. |
Order-flow arrivals#
The timing and clustering of trades: self-exciting arrival intensity.
Function |
Description |
|---|---|
Conditional intensity of an exponential-kernel Hawkes process: lambda_t = mu + kappa_t. |