aboutsummaryrefslogtreecommitdiffstats
path: root/R/thetas-curve.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/thetas-curve.R')
-rw-r--r--R/thetas-curve.R11
1 files changed, 9 insertions, 2 deletions
diff --git a/R/thetas-curve.R b/R/thetas-curve.R
index 427ac4ba..2923c83b 100644
--- a/R/thetas-curve.R
+++ b/R/thetas-curve.R
@@ -57,12 +57,19 @@ for(i in seq_along(unique.dates)) {
loginfo(paste("calibrating", index$name, tradedate))
exportYC(tradedate, "USD")
index <- set.index.desc(index, tradedate)
+ index$quotes <- quotes %>% filter(date == tradedate) %>%
+ inner_join(maturities, by="tenor") %>% arrange(maturity)
+ if(nrow(index$quotes) == 0) {
+ next
+ }
index <- set.singlenamesdata(index, tradedate)
+ if(is.null(index$portfolio)){
+ next
+ }
index$cs <- couponSchedule(IMMDate(tradedate, noadj=TRUE),
index$maturity, "Q", "FIXED", 1,
0, tradedate, IMMDate(tradedate, "prev"))
- index$quotes <- quotes %>% filter(date == tradedate) %>%
- right_join(maturities, by="tenor") %>% arrange(maturity)
+
tweak <- tweakcurves(index, tradedate)
index$portfolio <- tweak$portfolio
index$basis <- tweak$basis