aboutsummaryrefslogtreecommitdiffstats
path: root/R
diff options
context:
space:
mode:
Diffstat (limited to 'R')
-rw-r--r--R/build_portfolios.R4
-rw-r--r--R/build_scenarios.R5
-rw-r--r--R/intex_deal_functions.R10
3 files changed, 4 insertions, 15 deletions
diff --git a/R/build_portfolios.R b/R/build_portfolios.R
index 7c7687b5..30827e8d 100644
--- a/R/build_portfolios.R
+++ b/R/build_portfolios.R
@@ -9,9 +9,7 @@ if(.Platform$OS.type == "unix"){
root.dir <- "//WDSENTINEL/share/CorpCDOs"
}
-source(file.path(root.dir, "code", "R", "intex_deal_functions.R"))
-source(file.path(root.dir, "code", "R", "cds_utils.R"))
-source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
+source(file.path(root.dir, "code", "R", "intex_deal_functions.R"), chdir=TRUE)
source(file.path(root.dir, "code", "R", "yieldcurve.R"))
source(file.path(root.dir, "code", "R", "mlpdb.R"))
hy21 <- load.index("hy21")
diff --git a/R/build_scenarios.R b/R/build_scenarios.R
index d0dcd8bc..c1d7d5fa 100644
--- a/R/build_scenarios.R
+++ b/R/build_scenarios.R
@@ -35,13 +35,10 @@ if(length(args) >=2){
unlink(file.path(root.dir, "scripts", "deals_to_price.txt"))
}
-source(file.path(root.dir, "code", "R", "intex_deal_functions.R"))
+source(file.path(root.dir, "code", "R", "intex_deal_functions.R"), chdir=TRUE)
source(file.path(root.dir, "code", "R", "etdb.R"))
-source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
-source(file.path(root.dir, "code", "R", "cds_utils.R"))
source(file.path(root.dir, "code", "R", "yieldcurve.R"))
source(file.path(root.dir, "code", "R", "mlpdb.R"))
-hy21 <- load.index("hy21")
calibration.date <- addBusDay(tradedate, -1)
settledate <- addBusDay(tradedate, 3)
diff --git a/R/intex_deal_functions.R b/R/intex_deal_functions.R
index 524ca36e..f9167b0e 100644
--- a/R/intex_deal_functions.R
+++ b/R/intex_deal_functions.R
@@ -12,14 +12,8 @@ if(hostname=="debian"){
registerDoParallel(4)
}
-if(.Platform$OS.type == "unix"){
- root.dir <- "/home/share/CorpCDOs/"
-}else{
- root.dir <- "//WDSENTINEL/share/CorpCDOs/"
-}
-
-source(file.path(root.dir, "code", "R", "cds_functions_generic.R"))
-source(file.path(root.dir, "code", "R", "etdb.R"))
+source("cds_functions_generic.R")
+source("etdb.R")
getdealdata <- function(dealname, workdate){
sqlstring <- paste0("select marketvalue from et_deal_model_numbers where dealname='%s' and ",