LagOC {candlesticks}R Documentation

Lag a Open/Close Time Series

Description

Create a lagged series from Open and Close price data

Usage

LagOC(TS, k=1)

Arguments

TS

xts Time Series containing Open, High, Low and Close Prices

k

periods to lag

Details

shift series k-periods down, prepending NAs to front of series

Value

A xts object containing lagged Open and Close columns. The original column names are appended with '.Lag.k', with k being the periods to lag.

The returned series maintains the number of observations of the original.

Note

This function uses the Lag function of the quantmod package.

Author(s)

Andreas Voellenklee

See Also

Lag LagOHLC

Examples

## Not run: 
getSymbols('YHOO')
LagOC(YHOO)        # Lag OC series by one period
LagOC(YHOO, k=1:3) # Lag OC series by one, two and three periods
                   # this will return a 6 columns xts object

## End(Not run)

[Package candlesticks version 0.2-9 Index]