aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibrate_tranches_BC.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibrate_tranches_BC.R')
-rw-r--r--R/calibrate_tranches_BC.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/calibrate_tranches_BC.R b/R/calibrate_tranches_BC.R
index ac0d5fa7..9793fcbf 100644
--- a/R/calibrate_tranches_BC.R
+++ b/R/calibrate_tranches_BC.R
@@ -44,7 +44,10 @@ for(i in seq_along(runs$name)){
tenor <- runs$tenor[i]
filename <- file.path(root.dir,"Tranche_data","Runs",
paste(index.name,tenor,"csv",sep="."))
- if(args$update && file.exists(filename)){##ghetto way of getting the last row of the file
+ if(!file.exists(filename)){
+ args$update <- FALSE
+ }
+ if(args$update){##ghetto way of getting the last row of the file
runfile <- read.csv(filename)
begin.date <- as.Date(runfile[nrow(runfile),1])+1
}else{
@@ -63,9 +66,6 @@ for(i in seq_along(runs$name)){
next
}
alldates <- seq(begin.date, as.Date(as.character(args$until)), by="1 day")
- if(index.name=="ig19"){
- alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
- }
bus.dates <- alldates[isBusinessDay(calendar="UnitedStates/GovernmentBond", alldates)]
for(j in seq_along(bus.dates)){