aboutsummaryrefslogtreecommitdiffstats
path: root/R/yieldcurve.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/yieldcurve.R')
-rw-r--r--R/yieldcurve.R31
1 files changed, 10 insertions, 21 deletions
diff --git a/R/yieldcurve.R b/R/yieldcurve.R
index 163ac94e..94762c25 100644
--- a/R/yieldcurve.R
+++ b/R/yieldcurve.R
@@ -107,16 +107,15 @@ exportYC <- function(tradedate=Sys.Date(), currency="USD", useFutures=FALSE){
stop("wrong date")
}
sDate <- as.Date(MarkitData$deposits$spotdate[[1]])
- curveType <- sprintf("%s/%s", "Markit", currency)
- if(.Platform$OS.type == "unix"){
- setCalendarContext(calendar="WeekendsOnly", fixingDays=2,
- settleDate=sDate,
- curveType=curveType)
- }else{
- setCalendarContext(calendar="UnitedKingdom", fixingDays=2,
- settleDate=sDate)
- }
-
+ setCalendarContext(calendar="WeekendsOnly", fixingDays=2,
+ settleDate=sDate)
+ legparams <- switch(currency,
+ USD = list(fixFreq="Semiannual",
+ floatFreq="Quarterly",
+ dayCounter="Thirty360"),
+ EUR = list(fixfreq="Annual",
+ floatFreq="Semiannual",
+ dayCounter="Thirty360"))
params <- list(tradeDate=tradedate,
settleDate=sDate,
interpWhat="discount",
@@ -126,15 +125,5 @@ exportYC <- function(tradedate=Sys.Date(), currency="USD", useFutures=FALSE){
}else{
quotes <- buildMarkitYC(MarkitData, currency)
}
- L1m <- L2m <- L3m <- L6m <- L12m <- list(params=params, tsQuotes=quotes)
- L1m$params$dt <- 1/12
- L2m$params$dt <- 1/6
- L3m$params$dt <- 1/4
- L6m$params$dt <- 1/2
- L12m$params$dt <- 1
- assign("L1m", L1m, env = parent.env(environment()))
- assign("L2m", L2m, env = parent.env(environment()))
- assign("L3m", L3m, env = parent.env(environment()))
- assign("L6m", L6m, env = parent.env(environment()))
- assign("L12m", L12m, env = parent.env(environment()))
+ YC <<- list(params=params, tsQuotes=quotes, legparams=legparams)
}