volatility: Volatility

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Selected volatility estimators/indicators; various authors.

Usage

1
volatility(OHLC, n = 10, calc = "close", N = 260, mean0 = FALSE, ...)

Arguments

OHLC

Object that is coercible to xts or matrix and contains Open-High-Low-Close prices (or only Close prices, if calc="close").

n

Number of periods for the volatility estimate.

calc

The calculation (type) of estimator to use.

N

Number of periods per year.

mean0

Use a mean of 0 rather than the sample mean.

...

Arguments to be passed to/from other methods.

Details

Value

A object of the same class as OHLC or a vector (if try.xts fails) containing the chosen volatility estimator values.

Author(s)

Joshua Ulrich

References

The following sites were used to code/document these indicators. All were created by Thijs van den Berg under the GNU Free Documentation License and were retrieved on 2008-04-20. The original links are dead, but can be accessed via internet archives.

Close-to-Close Volatility (calc="close"):
https://web.archive.org/web/20100421083157/http://www.sitmo.com/eq/172

OHLC Volatility: Garman Klass (calc="garman.klass"):
https://web.archive.org/web/20100326172550/http://www.sitmo.com/eq/402

High-Low Volatility: Parkinson (calc="parkinson"):
https://web.archive.org/web/20100328195855/http://www.sitmo.com/eq/173

OHLC Volatility: Rogers Satchell (calc="rogers.satchell"):
https://web.archive.org/web/20091002233833/http://www.sitmo.com/eq/414

OHLC Volatility: Garman Klass - Yang Zhang (calc="gk.yz"):
https://web.archive.org/web/20100326215050/http://www.sitmo.com/eq/409

OHLC Volatility: Yang Zhang (calc="yang.zhang"):
https://web.archive.org/web/20100326215050/http://www.sitmo.com/eq/409

See Also

See TR and chaikinVolatility for other volatility measures.

Examples

1
2
3
4
5
6
7
data(ttrc)
ohlc <- ttrc[,c("Open","High","Low","Close")]
vClose <- volatility(ohlc, calc="close")
vClose0 <- volatility(ohlc, calc="close", mean0=TRUE)
vGK <- volatility(ohlc, calc="garman")
vParkinson <- volatility(ohlc, calc="parkinson")
vRS <- volatility(ohlc, calc="rogers")

TTR documentation built on Sept. 21, 2018, 6:31 p.m.