aboutsummaryrefslogtreecommitdiffstats
path: root/R/cds_utils.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/cds_utils.R')
-rw-r--r--R/cds_utils.R4
1 files changed, 2 insertions, 2 deletions
diff --git a/R/cds_utils.R b/R/cds_utils.R
index f7ab8708..0b9c81e8 100644
--- a/R/cds_utils.R
+++ b/R/cds_utils.R
@@ -5,7 +5,7 @@ today <- function() {
}
addBusDay <- function(tradedate = Sys.Date(), n.days = 3, calendar = "UnitedStates/GovernmentBond"){
- advance(calendar = "UnitedStates/GovernmentBond", dates=tradedate, n=n.days, timeUnit=0)
+ advance(calendar = calendar, dates=tradedate, n=n.days, timeUnit=0)
}
convertTenor <- function(tenor) {
@@ -115,7 +115,7 @@ IMMDate <- function(tradedate, type="next") {
## so if we trade on Friday, we're protected during the week-end
## matches with Bloomberg calculator
start.protection <- tradedate + 1
- startyear <- as.numeric(format(start.protection, "%Y"))
+ startyear <- as.numeric(format(start.protection, format="%Y"))
startyear <- startyear - 1
nextimmdates <- seq(as.Date(paste(startyear, 3, 20, sep="-")), length=9, by="3 months")
if(type == "next"){