EDGE Spread
Calculate the EDGE bid-ask spread of Ardia, Guidotti and Kroencke (2024), per asset and period.
EDGE (the Efficient Discrete Generalized Estimator) estimates the spread from the daily Open, High, Low and Close. The mid-range (the average of the High and Low) is a proxy for the efficient price, while the Open and the Close are trades at the bid or the ask, so the returns between them around the open and around 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.
Unlike the Corwin-Schultz and Abdi-Ranaldo spreads, which average two-day estimates, EDGE is estimated from all pairs of consecutive trading days of the period at once. For liquid large caps the spread is a few basis points, close to the estimation error, so read it as a relative measure there.
For more information about the method, see the following 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.
The formula is as follows:
\[\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.
Also known as: Efficient Discrete Generalized Estimator, EDGE estimator, OHLC spread estimator.
EDGE Spread in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_edge_spread as shown below.
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_edge_spread()
Or, after setting up the Finance Toolkit MCP, ask:
What was the bid-ask spread of Snap, Etsy and Lyft in each month of the first half of 2025, estimated from daily open, high, low and close prices with the EDGE method?
Which returns:
| Date | SNAP | ETSY | LYFT | Benchmark |
|---|---|---|---|---|
| 2025-01 | 0 | 0.0032 | 0 | 0.0019 |
| 2025-02 | 0.0121 | 0 | 0.0296 | 0.0045 |
| 2025-03 | 0 | 0 | 0 | 0.003 |
| 2025-04 | 0.0245 | 0.0176 | 0.0219 | 0.0135 |
| 2025-05 | 0.0173 | 0.0134 | 0 | 0.007 |
| 2025-06 | 0 | 0 | 0.0061 | 0.0017 |
Parameters
get_edge_spread accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to estimate the spread over (weekly, monthly, quarterly or yearly). Defaults to “monthly”, as in the paper. | "weekly" |
rolling | int | Estimate the spread from the pairs of the last rolling periods together instead of one period (e.g. period=’monthly’ and rolling=3 for a three-month spread at every month end). Defaults to None. | 4 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the spread over time. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
standardize | bool | Whether 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_columns | str | list[str] | None | The 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 |