volatility {TTR} | R Documentation |
Selected volatility estimators/indicators; various authors.
volatility(OHLC, n=10, calc="close", N=260, ...)
OHLC |
Object that is coercible to xts or matrix and contains Open-High-Low-Close prices. |
n |
Number of periods for the volatility estimate. |
calc |
The calculation (type) of estimator to use. |
N |
Number of periods per year. |
... |
Arguments to be passed to/from other methods. |
Close-to-Close Volatility (close
):
Historical volatility calculation using close-to-close prices.
OHLC Volatility: Garman Klass (garman.klass
):
The Garman and Klass estimator for estimating historical volatility assumes
Brownian motion with zero drift and no opening jumps (i.e. the opening = close
of the previous period). This estimator is 7.4 times more efficient than the
close-to-close estimator.
High-Low Volatility: Parkinson (parkinson
):
The Parkinson formula for estimating the historical volatility of an
underlying based on high and low prices.
OHLC Volatility: Rogers Satchell (rogers.satchell
):
The Roger and Satchell historical volatility estimator allows for non-zero
drift, but assumed no opening jump.
A object of the same class as OHLC
or a vector (if try.xts
fails) containing the chosen volatility estimator values.
Josh Ulrich
The following site(s) were used to code/document these indicators:
Close-to-Close Volatility (close
):
http://www.sitmo.com/eq/172
OHLC Volatility: Garman Klass (garman.klass
):
http://www.sitmo.com/eq/402
High-Low Volatility: Parkinson (parkinson
):
http://www.sitmo.com/eq/173
OHLC Volatility: Rogers Satchell (rogers.satchell
):
http://www.sitmo.com/eq/414
See EMA
, SMA
, etc. for moving average options; and note
Warning section. See TR
for another volatility measure.
data(ttrc) ohlc <- ttrc[,c("Open","High","Low","Close")] vClose <- volatility(ohlc, calc="close") vGK <- volatility(ohlc, calc="garman") vParkinson <- volatility(ohlc, calc="parkinson") vRS <- volatility(ohlc, calc="rogers")