Description Usage Arguments Details Value Author(s) Examples
View source: R/pub01_utilityFuncs.R
aggregate the asset quote series into specific freq.
1 | aggr.quote(quote, freq, var = "close")
|
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 |
var |
a character string, indicating the aggregated variable,could be:"open","close","high","low","vol",by default "close". |
The function could be used in quote of "open","close","high","low","vol",by specify different var
parametre
a aggregated quote series, of the same class of quote
.
Ruifei.yin
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.