Bid-Ask Spread

Calculate the bid-ask spread per asset and period: the cost of a round trip, estimated from daily prices alone, without quote data.

It uses the EDGE estimator of Ardia, Guidotti and Kroencke (2024), the high-low estimator of Corwin and Schultz (2012) or the close-high-low estimator of Abdi and Ranaldo (2017).

The daily High is almost always a trade at the ask and the daily Low a trade at the bid, while the Open and the Close are trades at either. The range of a day and the distance of the Open and Close to it therefore hold both the volatility and the bid-ask spread, and each estimator separates the two in its own way:

  • EDGE (the Efficient Discrete Generalized Estimator) takes the mid-range (the average of the High and Low) as a proxy for the efficient price; the returns between it and the Open and the Close bounce with the spread. Four such estimators, two at the open and two at the close (one of them a generalization of the Abdi-Ranaldo spread), are combined with the weights of the Generalized Method of Moments that minimize the variance of the estimate. The probabilities in the formula correct for days without trades, which repeat the previous Close. The estimate is asymptotically unbiased and, in the paper’s simulations and empirical tests, more precise than the Roll, Corwin-Schultz and Abdi-Ranaldo estimators. It is estimated from all pairs of consecutive trading days of the period at once.
  • Corwin-Schultz: the volatility part of the range grows with the length of the window while the spread part does not, so comparing the ranges of two single days with the range over both days together backs out the spread from the daily High and Low. Each pair of consecutive trading days gives an estimate and the spread of a period is the average of the estimates within it.
  • Abdi-Ranaldo: the distance of the Close to the mid-range of its own day and to that of the next day both hold half the spread, and their product removes the volatility of the efficient price. Unlike the Corwin-Schultz spread, the estimator uses the Close as well and needs no adjustment for the overnight return (a weekend or a gap at the open). Each pair of consecutive trading days gives an estimate and the spread of a period is the average of the estimates within it.

The estimators are mostly used where no quotes are available (historical studies, smaller markets) and rank assets well by their spread. For liquid large caps the spread is a few basis points, close to the estimation error and dominated by the volatility within the day, so read it as a relative measure there. The Roll spread, which uses the covariance of the close-to-close price changes, is get_roll_spread.

The formula is as follows:

For the EDGE spread:

\[\eta_{t} = \frac{h_{t} + l_{t}}{2}\;\;\text{and}\;\; \tau_{t} = 1 \;\text{if}\; h_{t} \text{≠} l_{t} \;\text{or}\; l_{t} \text{≠} c_{t-1},\;\; \text{else 0}\] \[\pi_{o} = - \frac{8}{P\left[o_{t} \text{≠} h_{t},\; \tau_{t} = 1\right] + P\left[o_{t} \text{≠} l_{t},\; \tau_{t} = 1\right]}\] \[\pi_{c} = - \frac{8}{P\left[c_{t-1} \text{≠} h_{t-1},\; \tau_{t} = 1\right] + P\left[c_{t-1} \text{≠} l_{t-1},\; \tau_{t} = 1\right]}\] \[x_{1} = \frac{\pi_{o}}{2} \cdot (\eta_{t} - o_{t}) \cdot (o_{t} - \eta_{t-1}) + \frac{\pi_{c}}{2} \cdot (\eta_{t} - c_{t-1}) \cdot (c_{t-1} - \eta_{t-1})\] \[x_{2} = \frac{\pi_{o}}{2} \cdot (\eta_{t} - o_{t}) \cdot (o_{t} - c_{t-1}) + \frac{\pi_{c}}{2} \cdot (o_{t} - c_{t-1}) \cdot (c_{t-1} - \eta_{t-1})\] \[S^{2} = \frac{\text{Var}\left[x_{2}\right] \cdot E\left[x_{1}\right] + \text{Var}\left[x_{1}\right] \cdot E\left[x_{2}\right]}{\text{Var}\left[x_{1}\right] + \text{Var}\left[x_{2}\right]}\] \[\text{EDGE Spread} = \sqrt{\max(S^{2},\; 0)}\]

Where o, h, l and c are the log Open, High, Low and Close of two consecutive trading days t-1 and t of the asset, and the probabilities, expectations and variances are taken over the pairs within the period. The returns \(\eta_{t} - o_{t}\), \(\eta_{t} - c_{t - 1}\) and \(o_{t} - c_{t - 1}\) in the first factor of each product are de-meaned over the pairs with \(\tau_{t} = 1\), as in the authors’ implementation. A negative squared spread of the period is set to 0, as in the paper (equation 26); setting the period’s estimate rather than each two-day estimate to 0 keeps the estimate consistent.

For the Corwin-Schultz spread:

\[\beta = \left[\ln\left(\frac{H_{t}}{L_{t}}\right)\right]^{2} + \left[\ln\left(\frac{H_{t+1}}{L_{t+1}}\right)\right]^{2}\] \[\gamma = \left[\ln\left(\frac{\max(H_{t},\; H_{t+1})}{\min(L_{t},\; L_{t+1})}\right)\right]^{2}\] \[\alpha = \frac{\sqrt{2 \beta} - \sqrt{\beta}}{3 - 2 \sqrt{2}} - \sqrt{\frac{\gamma}{3 - 2 \sqrt{2}}}\] \[\text{Two-Day Spread} = \max\left(\frac{2 \cdot (e^{\alpha} - 1)}{1 + e^{\alpha}},\; 0\right)\] \[\text{Corwin-Schultz Spread} = \operatorname{Mean}(\text{Two-Day Spreads within the period})\]

Where H and L are the daily High and Low of two consecutive trading days t and t+1 of the asset. Before \(\beta\) and \(\gamma\) are calculated, day t+1 is adjusted for the overnight return as in the paper: when its Low is above the Close of day t, its High and Low are lowered by the difference, and when its High is below that Close, they are raised by the difference. A negative two-day spread is set to 0, the paper’s main convention, before the average is taken.

For the Abdi-Ranaldo spread:

\[\eta_{t} = \frac{\ln H_{t} + \ln L_{t}}{2}\] \[\text{Two-Day Spread} = \sqrt{\max(4 \cdot (\ln C_{t} - \eta_{t}) \cdot (\ln C_{t} - \eta_{t+1}),\; 0)}\] \[\text{Abdi-Ranaldo Spread} = \operatorname{Mean}(\text{Two-Day Spreads within the period})\]

Where H, L and C are the daily High, Low and Close of two consecutive trading days t and t+1 of the asset. This is the “two-day corrected” version that the paper uses in its empirical analysis (equation 11): a negative two-day estimate of the squared spread is set to 0 before the square root and the average are taken.

Also known as: bid-ask spread estimator, effective spread, Efficient Discrete Generalized Estimator, EDGE spread, EDGE estimator, OHLC spread estimator, Corwin-Schultz spread, high-low spread estimator, HL spread, CS spread, Abdi-Ranaldo spread, close-high-low spread estimator, CHL spread, AR spread.

Example · SNAP, ETSY, LYFT · 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_bid_ask_spread:

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["SNAP", "ETSY", "LYFT"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-06-30",
)

toolkit.risk.get_bid_ask_spread()

Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:

What bid-ask spread do the daily prices of Snap, Etsy, Lyft and the S&P 500 imply for each month of the first half of 2025?

Which returns:

Parameters

get_bid_ask_spread accepts the following parameters.

ParameterTypeDescriptionExample
periodstrThe period to estimate the spread over. Options are: “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “monthly”, as in the papers."weekly"
rollingintEstimate the spread from the pairs of the last rolling periods together (method=”edge”), or average the two-day spreads of the last rolling periods (method=”corwin_schultz” and “abdi_ranaldo”), instead of one period (e.g. period=’monthly’ and rolling=3 for a three-month spread at every month end). At least 2. Defaults to None.4
methodstrThe estimator. Options are: “edge” (Ardia, Guidotti and Kroencke, from the Open, High, Low and Close), “corwin_schultz” (from the High and Low), “abdi_ranaldo” (from the Close, High and Low). Defaults to “edge”."edge"
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the spread over time. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column

References

  • Paper Ardia, D., Guidotti, E., & Kroencke, T. A. (2024). “Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices.” Journal of Financial Economics, 161, 103916.
  • Paper Corwin, S. A., & Schultz, P. (2012). “A Simple Way to Estimate Bid-Ask Spreads from Daily High and Low Prices.” The Journal of Finance, 67(2), 719-760.
  • Paper Abdi, F., & Ranaldo, A. (2017). “A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices.” The Review of Financial Studies, 30(12), 4437-4480.
  • Library Shares similar logic as RiskLabAI’s edge_estimator (EDGE)
  • Library Shares similar logic as RiskLabAI’s corwin_schultz_estimator (Corwin-Schultz)
Share