aboutsummaryrefslogtreecommitdiffstats
path: root/R/tranches_RV_BC.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/tranches_RV_BC.R')
-rw-r--r--R/tranches_RV_BC.R8
1 files changed, 5 insertions, 3 deletions
diff --git a/R/tranches_RV_BC.R b/R/tranches_RV_BC.R
index 112d13c0..31e1fab5 100644
--- a/R/tranches_RV_BC.R
+++ b/R/tranches_RV_BC.R
@@ -15,7 +15,9 @@ option_list <- list(
make_option(c("-t1", "--tenor1"), default="5yr",
help="Tenor of index1 [default %default]"),
make_option(c("-t2", "--tenor2"), default="5yr",
- help="Tenor of index2 [default %default]"))
+ help="Tenor of index2 [default %default]"),
+ make_option("--until", default=Sys.Date()-1,
+ help="last day to run [default %default]"))
args <- parse_args(OptionParser(option_list=option_list,
description=
@@ -54,10 +56,10 @@ for(i in seq_along(runs$name1)){
hy19 = as.Date("2013-10-04"),
ig21 = as.Date("2013-09-26"))
}
- if(begin.date == Sys.Date()){
+ if(begin.date > as.Date(args$until)){
next
}
- alldates <- seq(begin.date, Sys.Date()-1, by="1 day")
+ alldates <- seq(begin.date, as.Date(args$until), by="1 day")
if(index.name2=="ig19"){
alldates <- alldates[alldates!=as.Date("2013-11-29")] ##people are lazy the day after Thanksgiving
}