trday.nearby: trday.nearby

Description Usage Arguments Value Author(s) Examples

Description

get the nearby tradingday by shifting forward or backward.If the argument datelist is not a tradingday,the tradingday nearest by it will be firstly find by function trday.nearest.

Usage

1
2
trday.nearby(datelist, by, stockID = NULL, dir = if (by > 0) 1L else -1L,
  TS, drop)

Arguments

datelist

a vector of class Date

by

a integer giving the lagging days.If negetive,get the earlyer tradingday,if positive,get the later tradingday.

stockID

a character string or null. If null, the market trading days, other wise the trading days of specific stock.

dir

1L or -1L. see trday.nearest

Value

a vector of trading days of class Date

Author(s)

Ruifei.Yin

Examples

1
2
3
4
(datelist <- as.Date(c("2012-07-21","2012-07-22","2012-07-23","2013-01-30")))
trday.nearby(datelist,-20) # the tradingday 20 days earlyer than datelist
trday.nearby(datelist,20) # the tradingday 20 days later than datelist 
trday.nearby(datelist,20,stockID="EQ000527") 

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