aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/calibrate_tranches_BC.R19
1 files changed, 11 insertions, 8 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index 018460e7..09aa229f 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -35,13 +35,14 @@ if(updateflag){##ghetto way of getting the last row of the file
begin.date <- as.Date(runfile[nrow(runfile),1])+1
}else{
begin.date <- switch(index.name,
- hy10=as.Date("2014-06-10"),
- hy15=as.Date("2014-06-10"),
- hy17=as.Date("2014-06-10"),
- hy19=as.Date("2013-02-01"),
- hy21=as.Date("2013-10-04"),
- ig19=as.Date("2013-05-01"),
- ig21=as.Date("2013-09-26"),
+ hy10 = as.Date("2014-08-11"),
+ hy15 = as.Date("2014-06-10"),
+ hy17 = as.Date("2013-01-01"),
+ hy19 = as.Date("2013-02-01"),
+ hy21 = as.Date("2013-10-04"),
+ ig9 = as.Date("2013-01-01"),
+ ig19 = as.Date("2013-05-01"),
+ ig21 = as.Date("2013-09-26"),
)
}
@@ -49,11 +50,13 @@ alldates <- seq(begin.date, Sys.Date()-1, by="1 day")
if(index.name=="ig19"){
alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
}
-
bus.dates <- as.Date(names(which(isBusinessDay(calendar="UnitedStates/GovernmentBond", alldates))))
##check if we have all the quotes and save them
n.tranches <- 4
+if(index.name=="ig9"){
+ n.tranches <- 6
+}
quotes <- matrix(0, length(bus.dates), 2+2*n.tranches)
for(j in seq_along(bus.dates)){
tradedate <- bus.dates[j]