getRebDates: getRebDates

Description Usage Arguments Value Author(s) See Also Examples

View source: R/fct01_frameBuildingFuncs.R

Description

get the rebalance dates(a RebDates object) between begT and endT, and then shift it foreward if necessary.

Usage

1
getRebDates(begT, endT, rebFreq = "month", shiftby = 0, dates = NULL)

Arguments

begT

the begin date of class Date

endT

the end date of class Date

rebFreq

the rebalancing 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.) Or a character string of "allspan". "allspan" means no rebalance during the whole period between begT and endT, which could be realized also by a very large interval specification, eg. "100 year".

shiftby

a integer,how many days the rebalancing date be shifted foreward

dates

a vector of class Date.

Value

a RebDates object giving the rebalancing dates list,a vector with class of Date. If dates is not null, then return the dates themselves.

Author(s)

Ruifei.Yin

See Also

Other frame building functions: getTSF, getTSR, getTS

Examples

1
2
3
4
RebDates <- getRebDates(as.Date('2010-01-01'),as.Date('2012-06-30'),'3 month', 10)
getRebDates(as.Date('2010-01-01'),as.Date('2012-06-30'),'allspan')
getRebDates(as.Date('2010-01-01'),as.Date('2012-06-30'),'100 year')
getRebDates(dates=as.Date(c("2003-04-09","2003-07-06","2003-09-12")))

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