[R-sig-finance] fCalendar and Bizdays: 8 dec
Diethelm Wuertz
wuertz at itp.phys.ethz.ch
Thu Feb 2 16:18:00 CET 2006
You have to proceed in the following way:
# Write your holiday Calendar, see holiday.NYSE(), eg for the ATX
Trading Days ...
holiday.ATX =
function(y = 2005)
{
# See: http://www.indices.cc/cms/5/199/2163
if (y == 2005) {
holidays = c(
"2005-01-06", "2005-03-25", "2005-01-28",
"2005-05-05", "2005-05-16", "2005-05-26",
"2005-08-15", "2005-10-26", "2005-11-01",
"2005-12-08", "2006-12-26", "2005-12-30")
} else {
# Do it for all the other years of interest ...
# or generate them from some trading rules ...
stop("Not implemented")
}
ans = timeDate(charvec = holidays, format = NULL, zone = "Vienna",
FinCenter = "Vienna")
ans at FinCenter = "Europe/Vienna"
ans
}
# The data are recorded in zone="Vienna" and the Financial Center (where
to use the data) is also Vienna:
test = timeDate(c("2005-12-08", "2005-12-25"), zone = "Vienna",
FinCenter = "Vienna")
# Test ...
isBizday(test, holidays = holiday.ATX())
gives the right results.
DW
PS: There is a bug - currentYear - returns 2005
use to fix: currentYear = .currentYear()
This bug will be fixed with the next release/
Thomas Steiner wrote:
>>>isBizday(timeDate("2005-12-08"))
>>>
>>>
>>[1] TRUE
>>
>>
>
>of course it should be
>
>isBizday(timeDate("2005-12-08", FinCenter = "Vienna"))
>
>which returns TRUE as well.
>
>_______________________________________________
>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