dates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"), by=1)
isBusinessDay("UnitedStates", dates)
isBusinessDay("UnitedStates/Settlement", dates) ## same as previous
isBusinessDay("UnitedStates/NYSE", dates) ## stocks
isBusinessDay("UnitedStates/GovernmentBond", dates) ## bonds
isBusinessDay("UnitedStates/NERC", dates) ## energy
isHoliday("UnitedStates", dates)
isHoliday("UnitedStates/Settlement", dates) ## same as previous
isHoliday("UnitedStates/NYSE", dates) ## stocks
isHoliday("UnitedStates/GovernmentBond", dates) ## bonds
isHoliday("UnitedStates/NERC", dates) ## energy
isWeekend("UnitedStates", dates)
isWeekend("UnitedStates/Settlement", dates) ## same as previous
isWeekend("UnitedStates/NYSE", dates) ## stocks
isWeekend("UnitedStates/GovernmentBond", dates) ## bonds
isWeekend("UnitedStates/NERC", dates) ## energy
isEndOfMonth("UnitedStates", dates)
isEndOfMonth("UnitedStates/Settlement", dates) ## same as previous
isEndOfMonth("UnitedStates/NYSE", dates) ## stocks
isEndOfMonth("UnitedStates/GovernmentBond", dates) ## bonds
isEndOfMonth("UnitedStates/NERC", dates) ## energy
getEndOfMonth("UnitedStates", dates)
getEndOfMonth("UnitedStates/Settlement", dates) ## same as previous
getEndOfMonth("UnitedStates/NYSE", dates) ## stocks
getEndOfMonth("UnitedStates/GovernmentBond", dates) ## bonds
getEndOfMonth("UnitedStates/NERC", dates) ## energy
from <- as.Date("2009-04-07")
to<-as.Date("2009-04-14")
getHolidayList("UnitedStates", from, to)
to <- as.Date("2009-10-7")
getHolidayList("UnitedStates", from, to)
dates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"), by=1)
adjust("UnitedStates", dates)
adjust("UnitedStates/Settlement", dates) ## same as previous
adjust("UnitedStates/NYSE", dates) ## stocks
adjust("UnitedStates/GovernmentBond", dates) ## bonds
adjust("UnitedStates/NERC", dates) ## energy
advance("UnitedStates", dates, 10, 0)
advance("UnitedStates/Settlement", dates, 10, 1) ## same as previous
advance("UnitedStates/NYSE", dates, 10, 2) ## stocks
advance("UnitedStates/GovernmentBond", dates, 10, 3) ## bonds
advance("UnitedStates/NERC", dates, period = 3) ## energy
from <- as.Date("2009-04-07")
to<-as.Date("2009-04-14")
businessDaysBetween("UnitedStates", from, to)
startDates <- seq(from=as.Date("2009-04-07"), to=as.Date("2009-04-14"),by=1)
endDates <- seq(from=as.Date("2009-11-07"), to=as.Date("2009-11-14"), by=1)
dayCounters <- c(0,1,2,3,4,5,6,1)
dayCount(startDates, endDates, dayCounters)
yearFraction(startDates, endDates, dayCounters)
head(calendars, 10)
Run the code above in your browser using DataLab