Using OHLC Prices to Estimate Daily Volatility
Article Quant Q&A · Author: Avocado
Summary
The document explores estimating daily volatility for government bonds from open, high, low, and close prices. It notes that a daily high-low range can distinguish sessions with larger and smaller intraday fluctuations, then identifies the Garman-Klass estimator as an approach that uses OHLC data. The post includes an example using a volatility function from a statistical package, but does not provide a worked explanation of the estimator itself.
Key ideas
- OHLC prices can provide intraday range information that a close-only series omits.
- The post identifies Garman-Klass as an OHLC-based volatility estimator.
- The author asks whether the function expects a particular column order and how it handles missing values.
- The example produces initial missing estimates, but the document does not resolve whether these reflect a rolling window or another setting.
Tags
Full text
# A measure of volatility that uses open, close, low and high prices?
# A measure of volatility that uses open, close, low and high prices?
For my analysis I need a measure of volatility for government bonds. On Bloomberg I could not find any good measure of volatility - they offer some measures which are based on the close prices of each day (that is, from each day only one number is used), which is not precise enough, since I would like to have a measure of volatility for every day (fluctuations during the day).
However, from Bloomberg I can get open price, close price, high price and low price. The difference between high price and low price could be a simple measure which I could use to distinguish between days with large and small fluctuations. But are there some other ways to use these four numbers to get an estimation of volatility for every day? Thanks!
UPDATE: I can see in the comments that I can use Garman Klass volatility. I have tried to use in the package TTR, but a few things do not make sense to me. If I use the example in the help file:
```
library(TTR)
data(ttrc)
ohlc <- ttrc[,c("Open","High","Low","Close")]
MyVolatility=volatility(ohlc, calc="garman.klass")
```
Then MyVolatility will have an estimate for each day. But
- How does it know which variables are which? I have tried to change the name of "Close" to another name, and it still gives the calculations. So, should the variables have this exact ordering?
- Does it automatically take the right parameters, like N or is there something I need to specify?
- In this example the first 9 estimates in the MyVolatility are NA. Does that mean that each day's volatility is based on 9 days and not on single day? I mean, would it make sense to use this estimate to determine whether day t is different from day t+1 in terms of fluctuations?
- Finally, is there a way for it to stop giving error if one of the numbers is missing? Like, in other functions one can use na.rm=T.
To sum up, I would like to know the following. Suppose I have a dataframe MyData with many variables including Date, High_Price, Low_Price, Open_Price, Close_Price, and I would like to mutate the volatility estimate for each day like in dplyr. What do I have to write in my code? And what if I have different bonds in my dataset, is it possible to use dplyr with a group_by?
Thanks a lot!Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.