Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
This repository implements the efficient estimator of the effective bid-ask spread from open, high, low, and close prices described in:
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. doi: 10.1016/j.jfineco.2024.103916
The estimator is available in:
C++ | Julia | MATLAB | Python | R | SAS
You can also check the pseudocode to implement the estimator in any programming language. If you implement the estimator in a new programming language and want your implementation included in the repository, please open a pull request.
The following datasets are available to download:
Download | Dataset | Description |
---|---|---|
download | Bid-Ask Spread Estimates for U.S. Stocks in CRSP | Contains monthly estimates of the effective bid-ask spread for each stock in the CRSP U.S. Stock database |
download | Bid-Ask Spread Estimates for Crypto Pairs in Binance | Contains monthly estimates of the effective bid-ask spread for crypto pairs listed in Binance |
Each transaction price may generally include a different bid-ask spread, but the estimator only returns a single estimate given a sample of open, high, low, and close prices. What is the estimator computing exactly?
What is the minimum number of observations required by the estimator?
What is the recommended number of observations to use?
Does the estimator work with intraday data?
What is the recommended frequency to use?
Does the estimator work with tick data?
How to handle non-positive estimates?
sign=True
and reset negative values to zero. Keeping negative values is not recommended because more negative estimates are typically associated with larger spreads empirically. For more information, see https://github.com/eguidotti/bidask/issues/3Does the estimator work with missing values?
Do the functions
edge
andedge_rolling
produce the same results?
edge_rolling
is a version of edge
optimized for fast calculations over rolling windows. The two functions produce the same estimates when there are no missing values. If missing values are present, the two functions may provide slightly different estimates due to how missing values are handled, but both estimates are consistent.All code to replicate the paper is available here. The code meets the requirements of the cascad reproducibility policy for a rating of RRR.
You can browse publications related to the paper here.
All code is released under the MIT license. All data are released under the CC BY 4.0 license. When using any data or code from this repository, please cite the reference indicated below.
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. doi: 10.1016/j.jfineco.2024.103916
A BibTex entry for LaTeX users is:
@article{edge,
title = {Efficient estimation of bid–ask spreads from open, high, low, and close prices},
journal = {Journal of Financial Economics},
volume = {161},
pages = {103916},
year = {2024},
doi = {https://doi.org/10.1016/j.jfineco.2024.103916},
author = {David Ardia and Emanuele Guidotti and Tim A. Kroencke},
}