OHLC.Transformations {quantmod}R Documentation

Extract and Transform OHLC Time-Series Columns

Description

Extract (transformed) data from a suitable OHLC object. Column names must contain the complete description - either “Open”, “High”, “Low”, “Close”, “Volume”, or “Adjusted” - though may also contain additional characters. This is the default for objects returned from most getSymbols calls.

In the case of functions consisting of combined Op, Hi, Lo, Cl (e.g. ClCl(x)) the one period transformation will be applied.

For example, to return the Open to Close of a object it is possible to call OpCl(x). If multiple periods are desired a call to the function Delt is necessary.

seriesLo and seriesHi will return the low and high, respectively, of a given series.

HLC extracts the High, Low, and Close columns. OHLC extracts the Open, High, Low, and Close columns.

These functions are merely to speed the model specification process. All columns may also be extracted through standard R methods.

Assignment will not work at present.

Usage

Op(x)
Hi(x)
Lo(x)
Cl(x)
Vo(x)
Ad(x)

seriesHi(x)
seriesLo(x)

OpCl(x)
ClCl(x)
HiCl(x)
LoCl(x)
LoHi(x)
OpHi(x)
OpLo(x)
OpOp(x)

HLC(x)
OHLC(x)

Arguments

x A data object with columns containing data to be extracted.

Details

Internally, the code uses grep to locate the appropriate columns. Therefore it is necessary to use inputs with column names matching the requirements in the description section, though the exact naming convention is not as important.

Value

Returns an object of the same class as the original series, with the appropriately column names if applicable and/or possible. The only exceptions are for quantmod.OHLC objects which will be returned as zoo objects, and calls to seriesLo and seriesHi which may return a numeric value instead of the original object type.

Author(s)

Jeffrey A. Ryan

See Also

specifyModel

Examples

## Not run: 
getSymbols('IBM',src='yahoo')
Ad(IBM)
Cl(IBM)
ClCl(IBM)

seriesHi(IBM)
seriesHi(Lo(IBM))

removeSymbols('IBM')
## End(Not run)

[Package quantmod version 0.3-6 Index]