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

Bulk Volume Classifier (BVC)

Buy-initiated share of a bar's volume estimated as the normal CDF of return / trailing-window volatility.

Lee-Ready Trade Sign

Trade sign by the Lee-Ready (1991) rule: quote test with tick-rule fallback.

Signed Volume

Aggressor-signed volume, sign * volume.

Tick Rule Sign

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 Order-Flow Imbalance (order book)

Cont-Kukanov-Stoikov (2014) order-flow imbalance from L1 book events.

Order-Flow Imbalance

Normalized signed order flow, (buy - sell) / (buy + sell).

Queue (Book) Imbalance

Normalized L1 book imbalance, (bid_size - ask_size) / (bid_size + ask_size).

Rolling Order Imbalance

Trailing-window sum of signed order flow (Chordia-Roll-Subrahmanyam imbalance).

VPIN Order-Flow Toxicity

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

Amihud Illiquidity

Rolling mean of |return| / notional (Amihud 2002 illiquidity ratio).

Effective Spread

Effective spread, 2*|price - mid|: the round-trip cost paid relative to the mid.

Kyle's Lambda (exponentially weighted)

Exponentially-weighted price-impact slope of return on signed order flow.

Micro-Price (imbalance-weighted mid)

Imbalance-weighted mid (Stoikov 2018, first-order): fair value that leans toward the thinner side of the book.

Bouchaud Propagator Price Impact

Bouchaud (2004) propagator model: price impact as a decaying-kernel convolution over past signed order flow.

Realized Spread

Realized spread, 2*D*(price - mid a few steps later): the liquidity part of the effective spread.

Kyle's Lambda (rolling)

Rolling-window price-impact slope of return on signed order flow (Kyle 1985).

Roll Effective Spread

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

Hawkes Process Conditional Intensity

Conditional intensity of an exponential-kernel Hawkes process: lambda_t = mu + kappa_t.