Learn R Programming

⚠️There's a newer version (2.1.4) of this package.Take me there.

Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices

Implements an efficient estimator of bid-ask spreads from open, high, low, and close prices.

Installation

Install this package with:

install.packages("bidask")

Usage

Load the library:

library("bidask")

Arguments:

edge(open, high, low, close, sign=FALSE)
fielddescription
openNumeric vector of open prices
highNumeric vector of high prices
lowNumeric vector of low prices
closeNumeric vector of close prices
signWhether signed estimates should be returned

The input prices must be sorted in ascending order of the timestamp.

The output value is the spread estimate. A value of 0.01 corresponds to a spread of 1%.

Example

library("bidask")

df = read.csv("https://raw.githubusercontent.com/eguidotti/bidask/main/pseudocode/ohlc.csv")
edge(df$Open, df$High, df$Low, df$Close)

Cite as

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},
}

Copy Link

Version

Install

install.packages('bidask')

Monthly Downloads

391

Version

2.0.6

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Emanuele Guidotti

Last Published

August 18th, 2024

Functions in bidask (2.0.6)

ROLL

Roll Estimator
sim

Simulation of Open, High, Low, and Close Prices
spread

Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
edge

Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
rsum

Rolling sum
rmean

Rolling mean
AR

Abdi-Ranaldo Estimator
bidask-package

bidask: Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
OHLC

OHLC Estimators
CS

Corwin-Schultz Estimator