aggr.quote: aggr.quote

Description Usage Arguments Details Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

aggregate the asset quote series into specific freq.

Usage

1
aggr.quote(quote, freq, var = "close")

Arguments

quote

an xts, vector, matrix, data frame, timeSeries or zoo object of asset price

freq

An interval specification, one of "day", "week", "month", "quarter" and "year", optionally preceded by an integer and a space, or followed by "s".See cut.Date for detail.

var

a character string, indicating the aggregated variable,could be:"open","close","high","low","vol",by default "close".

Details

The function could be used in quote of "open","close","high","low","vol",by specify different var parametre

Value

a aggregated quote series, of the same class of quote.

Author(s)

Ruifei.yin

Examples

1
2
3
4
5
rtn.long <- zoo(rnorm(100,0.001,0.02),as.Date("2010-01-01")+1:100)
rtn.short <- rtn.long + rnorm(100,-0.001,0.003)
rtn <- merge(rtn.long,rtn.short)
price.close <- WealthIndex(rtn)
aggr.quote(price.close,"month")

QuantAndrew/QUtility documentation built on May 14, 2019, 7:36 a.m.