diff options
Diffstat (limited to 'R/tranches_RV_BC.R')
| -rw-r--r-- | R/tranches_RV_BC.R | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/R/tranches_RV_BC.R b/R/tranches_RV_BC.R index 31e1fab5..a7cd368a 100644 --- a/R/tranches_RV_BC.R +++ b/R/tranches_RV_BC.R @@ -3,7 +3,10 @@ if(.Platform$OS.type == "unix"){ }else{
root.dir <- "//WDSENTINEL/share/CorpCDOs"
}
-
+library(logging)
+basicConfig()
+removeHandler('basic.stdout')
+addHandler(writeToFile, file=file.path(root.dir, "logs", "tranches_RV_BC.log"))
library(optparse)
option_list <- list(
make_option(c("-u", "--update"), action="store_true", default=FALSE,
@@ -69,6 +72,10 @@ for(i in seq_along(runs$name1)){ tradedate <- bus.dates[j]
index1 <- load.index(index.name1, tenor1, tradedate)
index2 <- load.index(index.name2, tenor2, tradedate)
+ if(any(c(is.null(index1), is.null(index2)))){
+ loginfo(paste("skipping pair ", index.name1, tenor1, index.name2, tenor2))
+ break
+ }
accrued2 <- cdsAccrued(tradedate, index2$tranches$running)
mappedpv <- list()
for(method in c("ATM", "TLP", "PM")){
@@ -89,4 +96,5 @@ for(i in seq_along(runs$name1)){ }
cat(paste(row, collapse=","), "\n", file=filename, append=TRUE)
}
+
}
|
