Description Usage Arguments Value Author(s) See Also Examples
get the benchmark return series corresponding to the specific rtn series.
1 | getrtn.bmk(rtn, bmk, date_start_pad, drop = FALSE)
|
rtn |
an xts,timeSeries or zoo object of portfolio returns. |
bmk |
a character string, giving the stockID of the benchmark index,eg. "EI000300". |
date_start_pad |
a Date value, indicating the start point of the first rtn period. If missing, padded by an approximate value. |
a xts object, giving the rtn series of the benchmark
Ruifei.Yin
Other LSH-frame building functions: addrtn.hedge
,
getrtn.LBH
, getrtn.LSH
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # -- daily rtn
dates <- getRebDates(as.Date("2011-03-01"),as.Date("2011-04-20"),rebFreq = "day")
TS <- getTS(dates,stocks = "EQ000002")
TSR <- getTSR(TS)
rtn <- xts::xts(TSR$periodrtn,TSR$date_end)
re <- getrtn.bmk(rtn,"EI000300")
# -- IF00 as bmk
re_IF <- getrtn.bmk(rtn,"IF00")
# -- none daily rtn
dates <- getRebDates(as.Date("2010-03-01"),as.Date("2011-04-20"),rebFreq = "month")
TS <- getTS(dates,stocks = "EQ000002")
TSR <- getTSR(TS)
rtn <- xts::xts(TSR$periodrtn,TSR$date_end)
re <- getrtn.bmk(rtn,"EI000300")
re2 <- getrtn.bmk(rtn,"EI000300",date_start_pad=as.Date("2010-03-01"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.