[R-SIG-Finance] isBizday question
Diethelm Wuertz
wuertz at itp.phys.ethz.ch
Thu Oct 5 20:48:21 CEST 2006
Joe Byers wrote:
>I have the following code to create a calendar time sequence to perform
>a simulation
>MTMDate<-'2006-09-25';
>lastDay<-'2007-03-31';
>traj<-500;
>##############end input section
>dt<-1/365;
>
>#build calendar
>calday<-timeSequence(from = MTMDate, to = lastDay,by =
>"day",FinCenter='America/Eastern')
>#get rid of holidays and weekends
>calday<-calday[isBizday(calday,holidays=holiday.NYSE())];
>
>
You have to set the year, e.g.
> holiday.NYSE()
[1] "America/New_York"
[1] [2006-01-02] [2006-01-16] [2006-02-20] [2006-04-14] [2006-05-29]
[2006-07-04]
[7] [2006-09-04] [2006-11-23] [2006-12-25]
> holiday.NYSE(2005:2006)
[1] "America/New_York"
[1] [2005-01-17] [2005-02-21] [2005-03-25] [2005-05-30] [2005-07-04]
[2005-09-05]
[7] [2005-11-24] [2005-12-26] [2006-01-02] [2006-01-16] [2006-02-20]
[2006-04-14]
[13] [2006-05-29] [2006-07-04] [2006-09-04] [2006-11-23] [2006-12-25]
> help(holiday.NYSE)
regards DW
>The problem is that the holidays are only eliminated for the current
>year, 2006, not the next year 2007.
>
>
that's not true read the help page.
>Does anyone have a suggestion that I can use to get the isBizday method
>to also see the multiple years for the holidays?
>
>Thank you
>Joe
>
>_______________________________________________
>R-SIG-Finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>
>
More information about the R-SIG-Finance
mailing list