diff options
| -rw-r--r-- | R/build_scenarios.R | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/R/build_scenarios.R b/R/build_scenarios.R index 722fb8a4..b5d485aa 100644 --- a/R/build_scenarios.R +++ b/R/build_scenarios.R @@ -15,25 +15,26 @@ if(.Platform$OS.type == "unix"){ }else{
root.dir <- "//WDSENTINEL/share/CorpCDOs"
}
-code.dir <- if(Sys.getenv("CODE_DIR")=="") root.dir else Sys.getenv("CODE_DIR")
-
-if(length(args) >= 1){
- tradedate <- as.Date(args[1])
-}else{
- tradedate <- Sys.Date()
-}
-
-if(length(args) >=2){
- argslist <- strsplit(args[-1], ",")
- dealnames <- unlist(lapply(argslist, function(x)x[1]))
- reinvflags <- as.logical(unlist(lapply(argslist, function(x)x[2])))
-}
+code.dir <- if(Sys.getenv("CODE_DIR")=="") root.dir else Sys.getenv("CODE_DIR")
source(file.path(code.dir, "code", "R", "intex_deal_functions.R"), chdir=TRUE)
source(file.path(code.dir, "code", "R", "yieldcurve.R"))
source(file.path(code.dir, "code", "R", "serenitasdb.R"), chdir=TRUE)
source(file.path(code.dir, "code", "R", "tranche_functions.R"))
+if(interactive()) {
+ tradedate <- as.Date("2016-02-25")
+ dealnames <- c("beto", "ozlmf5")
+ reinvflags <- c(TRUE, TRUE)
+}else{
+ tradedate <- as.Date(args[1])
+ if(length(args) >=2){
+ argslist <- strsplit(args[-1], ",")
+ dealnames <- unlist(lapply(argslist, function(x)x[1]))
+ reinvflags <- as.logical(unlist(lapply(argslist, function(x)x[2])))
+ }
+}
+
calibration.date <- addBusDay(tradedate, -1)
settledate <- addBusDay(tradedate, 3)
calibration <- read.table(file.path(root.dir, "Scenarios", "Calibration",
|
