Description Usage Arguments Value Author(s) See Also Examples
View source: R/fct01_frameBuildingFuncs.R
get the 'time*stock frame'(a TS object) given the rebalancing dates and the universe. The universe could be a index, a sector or a plate.
1 |
RebDates |
a RebDates object. a vector,with class of Date,usually the rebalancing dates list |
indexID |
a character string. The ID of the index, sector or plate. Could be a single-ID-code(eg. "EI000300","ES09440000",...) or a more complicated express containing some set operations and ID-codes(eg. "setdiff(union(EI000300,EI399006),ES09440000)"). See detail in |
stocks |
a vector of stockIDs |
rm |
could be one or more of "suspend","priceLimit".default is NULL |
a TS object. a dataframe,with cols:
date: the rebalance dates, with Date
class
stockID: the stockID
.IF stocks is not null then return expand.grid
of stocks and RebDates, else return components of index on RebDates.
Ruifei.Yin
Other frame building functions: getRebDates
,
getTSF
, getTSR
1 2 3 4 5 | RebDates <- getRebDates(as.Date('2011-03-17'),as.Date('2012-04-17'),'month')
TS <- getTS(RebDates,'EI000300')
TS2 <- getTS(RebDates,'ES09440000') # financial servive sector
TS3 <- getTS(RebDates,'setdiff(EI000300,ES09440000)') # CSI300 ex. financial servive sector
TS4 <- getTS(RebDates,stocks=c("EQ000002","EQ000023","EQ600000"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.