Corwin-Schultz Spread Estimator
Install and import#
npm install fintech-algorithmsimport { corwinSchultzSpread } from "fintech-algorithms/market-microstructure/liquidity-and-spreads/corwin-schultz-spread-estimator";Signature#
corwinSchultzSpread(highDay1, lowDay1, highDay2, lowDay2, clipNegative)Estimates the spread from daily high-low ranges over two days, exploiting that the range reflects both volatility and spread while volatility scales with time and the spread does not. Frequently returns negative values, which are theoretically impossible.
Parameters#
| Name | Type | Notes |
|---|---|---|
highDay1 | number | First day's high. |
lowDay1 | number | First day's low. |
highDay2 | number | Second day's high. |
lowDay2 | number | Second day's low. |
clipNegative | boolean | Whether to clip negative estimates to zero. Corwin and Schultz recommend it; leaving them visible is more honest when averaging across a sample. |
Returns#
{ spread, raw_spread, beta, gamma, alpha, clipped }
The estimate with every intermediate, and whether clipping was applied.
Errors#
- When any high is below its low — throws
Complexity: time O(1),
space O(1).
Worked example#
executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.
Input#
10199101.599.5trueCall#
corwinSchultzSpread(highDay1, lowDay1, highDay2, lowDay2, clipNegative)Returns#
object with 9 fields: model, beta, gamma, alpha_raw, alpha_used, spread_estimate_relative, spread_estimate_bps, clip_negative, …
{
"model": "corwin-schultz-spread",
"beta": 0.0007960826118720654,
"gamma": 0.0006219511446669105,
"alpha_raw": 0.007908933752463966,
"alpha_used": 0.007908933752463966,
"spread_estimate_relative": 0.007908892526591878,
"spread_estimate_bps": 79.08892526591879,
"clip_negative": true,
"state": "estimated"
}Other exports#
This module also exports
quotedSpread, effectiveSpread, realizedSpread, rollSpread, amihudIlliquidity, calculate. Every module additionally exports run as an alias of its
primary function, and a meta object carrying its catalog id, domain, family,
shape and article URL.
Diagrams#
Calculation flow#
Corwin-Schultz Spread Estimator validation flow
flowchart LR
A["Question: Can two consecutive daily high–low ranges separate spread from fundamental volatility?"] --> B["Freeze instrument, scope, clock, units, and variant"]
B --> C["Validate Corwin-Schultz Spread Estimator inputs"]
C --> D{"Eligible and synchronized?"}
D -- "No" --> E["Reject with topic-specific reason"]
D -- "Yes" --> F["Apply the frozen High–low spread formula"]
F --> G["Expose intermediate value and decision state"]
G --> H{"Direct measure or model-based proxy?"}
H --> I["Report result with its unit and limitation"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- Corwin and Schultz (2012), A Simple Way to Estimate Bid-Ask Spreads — The Journal of Finance
- NYSE Daily TAQ product description — New York Stock Exchange