edge | R Documentation |
Implements an efficient estimator of bid-ask spreads from open, high, low, and close prices as described in Ardia, Guidotti, & Kroencke (2024).
edge(open, high, low, close, sign = FALSE)
open |
numeric vector of open prices. |
high |
numeric vector of high prices. |
low |
numeric vector of low prices. |
close |
numeric vector of close prices. |
sign |
whether signed estimates should be returned. |
Prices must be sorted in ascending order of the timestamp.
The spread estimate. A value of 0.01 corresponds to a spread of 1%.
Please cite Ardia, Guidotti, & Kroencke (2024) when using this package in publication.
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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jfineco.2024.103916")}
# simulate open, high, low, and close prices with spread 1%
x <- sim(spread = 0.01)
# estimate the spread
edge(x$Open, x$High, x$Low, x$Close)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.