diff options
| -rw-r--r-- | R/thetas-curve.R | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/R/thetas-curve.R b/R/thetas-curve.R index 7c918b08..427ac4ba 100644 --- a/R/thetas-curve.R +++ b/R/thetas-curve.R @@ -17,7 +17,8 @@ index.closeprice <- function(index=c("IG", "HY", "EU", "XO"), series) { df <- index.quotes %>% filter_(lazyeval::interp(~series == s, s=series)) %>% filter_(interp(~index == i, i=index)) %>% arrange(date) - df <- df %>% select(date, tenor, closeprice) %>% + df <- df %>% filter(theta2 %is% `NULL`) %>% + select(date, tenor, closeprice) %>% rename(price=closeprice) %>% mutate(price=price/100) %>% collect() return( df ) @@ -61,7 +62,7 @@ for(i in seq_along(unique.dates)) { index$maturity, "Q", "FIXED", 1, 0, tradedate, IMMDate(tradedate, "prev")) index$quotes <- quotes %>% filter(date == tradedate) %>% - left_join(maturities) %>% arrange(maturity) + right_join(maturities, by="tenor") %>% arrange(maturity) tweak <- tweakcurves(index, tradedate) index$portfolio <- tweak$portfolio index$basis <- tweak$basis |
