Bekker-Parkinson Volatility
Calculate the Bekker-Parkinson Volatility per asset and period: the volatility in the daily High/Low range once the bid-ask spread of Corwin and Schultz (2012) is taken out.
The daily High is almost always a trade at the ask and the daily Low one at the bid, so the range of a day holds both the volatility and the spread, and a range-based volatility such as Parkinson’s overstates the volatility of an asset with a wide spread. Corwin and Schultz write the expected squared range of one day and of two days in terms of the spread and the volatility; the spread part does not grow with the length of the window while the volatility part does. Solving the two equations for the spread gives the Corwin-Schultz spread (get_bid_ask_spread), and solving them for the volatility gives this estimate, as López de Prado (2018, section 19.3.4 and snippet 19.2) does; RiskLabAI names it the Bekker-Parkinson volatility.
The formula is as follows:
\[\beta = \left[\ln\left(\frac{H_{t}}{L_{t}}\right)\right]^{2} + \left[\ln\left(\frac{H_{t+1}}{L_{t+1}}\right)\right]^{2}\] \[\gamma = \left[\ln\left(\frac{\max(H_{t},\; H_{t+1})}{\min(L_{t},\; L_{t+1})}\right)\right]^{2}\] \[k_{2} = \sqrt{\frac{8}{\pi}}\] \[\sigma_{t} = \max\left(\frac{\sqrt{\frac{\beta}{2}} - \sqrt{\beta}}{k_{2} \cdot (3 - 2 \sqrt{2})} + \sqrt{\frac{\gamma}{k_{2}^{2} \cdot (3 - 2 \sqrt{2})}},\; 0\right)\] \[\text{Bekker-Parkinson Volatility} = \operatorname{Mean}(\sigma_{t} \;\text{within the period}) \cdot \sqrt{\text{Trading Days per Period}}\]Where H and L are the daily High and Low of two consecutive trading days t and t+1 of the asset, with the overnight adjustment of day t+1 of the Corwin-Schultz spread. \(\sigma_{t}\) is the volatility of the log price (continuously compounded) over one day; the mean is scaled to the period as the Parkinson Volatility of get_volatility is, by the square root of the trading days per period (252 / 12 for monthly, or 365 / 12 for a ticker that trades on weekends).
Also known as: Corwin-Schultz volatility, spread-adjusted high-low volatility.
Example · SNAP, ETSY, LYFT · 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_bekker_parkinson_volatility:
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_bekker_parkinson_volatility()
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What was the Bekker-Parkinson volatility of Snap, Etsy, Lyft and the S&P 500 in each month of the first half of 2025?
Which returns:
| Date | SNAP | ETSY | LYFT | Benchmark |
|---|---|---|---|---|
| 2025-01 | 0.1554 | 0.1103 | 0.1333 | 0.0300 |
| 2025-02 | 0.1062 | 0.1188 | 0.1899 | 0.0311 |
| 2025-03 | 0.1375 | 0.1276 | 0.1383 | 0.0458 |
| 2025-04 | 0.1692 | 0.1336 | 0.1422 | 0.0851 |
| 2025-05 | 0.1086 | 0.1143 | 0.1353 | 0.0319 |
| 2025-06 | 0.1184 | 0.1271 | 0.0643 | 0.0236 |
6 rows
Parameters
get_bekker_parkinson_volatility accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
period | str | The period to estimate the volatility over and scale to. Options are: “weekly”, “monthly”, “quarterly”, “yearly”. Defaults to “monthly”, as for the Corwin-Schultz spread. | "weekly" |
rolling | int | Average the two-day volatilities of the last rolling periods instead of one period (e.g. period=’monthly’ and rolling=3 for a three-month estimate at every month end). At least 2. 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 volatility 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 |
References
- Paper Corwin, S. A., & Schultz, P. (2012). “A Simple Way to Estimate Bid-Ask Spreads from Daily High and Low Prices.” The Journal of Finance, 67(2), 719-760.
- Paper López de Prado, M. (2018). “Advances in Financial Machine Learning.” Wiley, section 19.3.4.
- Paper Parkinson, M. (1980). “The Extreme Value Method for Estimating the Variance of the Rate of Return.” Journal of Business, 53(1), 61-65.
- Library Shares similar logic as RiskLabAI’s bekker_parkinson_volatility_estimates