getTS: getTS

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fct01_frameBuildingFuncs.R

Description

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.

Usage

1
getTS(RebDates, indexID = "EI000300", stocks = NULL, rm = NULL)

Arguments

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 getComps.

stocks

a vector of stockIDs

rm

could be one or more of "suspend","priceLimit".default is NULL

Value

a TS object. a dataframe,with cols:

.IF stocks is not null then return expand.grid of stocks and RebDates, else return components of index on RebDates.

Author(s)

Ruifei.Yin

See Also

getComps

Other frame building functions: getRebDates, getTSF, getTSR

Examples

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"))

QuantAndrew/QDataGet documentation built on May 14, 2019, 7:35 a.m.