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, ...)

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.

...

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 links are currently dead, but can be accessed via internet archives.

Close-to-Close Volatility (calc="close"):
http://www.sitmo.com/eq/172

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

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

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

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

OHLC Volatility: Yang Zhang (calc="yang.zhang"):
http://www.sitmo.com/eq/417

See Also

See TR and chaikinVolatility for other volatility measures.

Examples

1
2
3
4
5
6
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")

TTR documentation built on April 15, 2017, 8:31 a.m.

Search within the TTR package
Search all R packages, documentation and source code