Skip to content
All library documents

Estimating Spreads and Liquidity Stress from OHLCV Data

Article TradingView scripts

Summary

This indicator estimates trading costs and liquidity conditions from bar data rather than order-book or trade-level observations. It combines several spread estimators, including Roll’s price-change covariance, Corwin–Schultz’s two-period high-low method, and Abdi–Ranaldo’s close-to-bar-midpoint approach. It also calculates an effective-spread proxy, Amihud illiquidity, Kyle price impact, and Parkinson range-based volatility. A precision-weighted composite spread, robust median-absolute-deviation scores, and an equal-weight Liquidity Stress Index summarize the component readings.

The dashboard and alerts are intended to flag widening spreads, liquidity stress, or elevated estimated price impact. The document explicitly cautions that bar aggregation limits these methods: Roll can be biased downward, tick-rule estimates degrade on longer timeframes, and using the high-low midpoint can bias effective spread upward. Rolling MAD is an approximation. These outputs are statistical proxies for analysis, not direct measurements of quoted spreads, order flow, or executable liquidity.

Key ideas

  • The indicator applies multiple published spread estimators to OHLCV bars and combines their outputs.
  • Amihud illiquidity, Kyle lambda, and Parkinson volatility add trading-activity and price-impact context.
  • Robust z-scores and a composite Liquidity Stress Index summarize unusual conditions across measures.
  • Bar aggregation and proxy inputs can bias estimates, so outputs should not be treated as order-book facts.
  • The script is presented for analytical use and does not provide evidence that its signals predict returns.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.