Description Usage Arguments Value Author(s) Examples
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
.
1 2 |
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 |
a vector of trading days of class Date
Ruifei.Yin
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.