Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
Project description
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:
pip install bidask
Usage
Import the estimator:
from bidask import edge
Arguments:
edge(open, high, low, close, sign=False)
field | description |
---|---|
open |
Array-like vector of open prices |
high |
Array-like vector of high prices |
low |
Array-like vector of low prices |
close |
Array-like vector of close prices |
sign |
Whether 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
import pandas as pd
from bidask import edge
df = pd.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},
}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bidask-2.0.1.tar.gz
.
File metadata
- Download URL: bidask-2.0.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.13 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab892fe3e2e4694eaf399d6b431fada7497a9b635590a203424826abc9773655 |
|
MD5 | 0ef0860d9c38a09c0d8192f75324b62a |
|
BLAKE2b-256 | d06151646ce3d8d72a3e4be7209d505ed6e271a9066b3f6c8d75ceb3be701644 |
File details
Details for the file bidask-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: bidask-2.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.13 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a00f3f9d68692e3077d9baf2b17108654a3b08739a7abc3cdd1d643ade8badc |
|
MD5 | d077262e349363a699c858c1bb4e7b29 |
|
BLAKE2b-256 | 1560a4b842748c8b2e55cbbf78453256ddd13aa413edeb65c593b8b1fe5dd81c |