aboutsummaryrefslogtreecommitdiffstats
path: root/R/intex_deal_functions.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/intex_deal_functions.R')
-rw-r--r--R/intex_deal_functions.R8
1 files changed, 4 insertions, 4 deletions
diff --git a/R/intex_deal_functions.R b/R/intex_deal_functions.R
index b1d3582f..6d1172d6 100644
--- a/R/intex_deal_functions.R
+++ b/R/intex_deal_functions.R
@@ -218,8 +218,8 @@ buildSC <- function(line.item, reinvdate, dealmaturity, global.params, startdate
SC <- stackcurve(SC, line.item, global.params, SC@startdate)
cs <- couponSchedule(line.item$nextpaydate, line.item$maturity,
line.item$frequency, line.item$fixedorfloat,
- line.item$grosscoupon*0.01, line.item$spread*0.01)
- line.item$price <- bondpv(cs, SC@curve, recovery(line.item)) * 100
+ line.item$grosscoupon*0.01, line.item$spread*0.01, startdate)
+ line.item$price <- bondpv(cs, SC@curve, recovery(line.item), startdate) * 100
}else{ #normal case
if(!is.na(line.item$assettype) && line.item$assettype=="Bond"){ #no prepay rate
alpha <- 0
@@ -227,7 +227,7 @@ buildSC <- function(line.item, reinvdate, dealmaturity, global.params, startdate
alpha <- global.params$alpha
}
try <- bondhazardrate.shaped(line.item, global.params$shape,
- recovery(line.item), alpha, global.params$beta)
+ recovery(line.item), alpha, global.params$beta, startdate)
if(is.null(try)){
SC <- stackcurve(SC, line.item, global.params, SC@startdate)
}else{
@@ -378,7 +378,7 @@ intexportfolio.forwardprice <- function(cdrmonthly, recoverymonthly, startdate,
}
forwardcs <- data.table(couponSchedule(nextpaydate=startdate+45, maturity,
frequency="Q", coupontype, margin,
- currentcoupon, startdate=startdate), key="dates")
+ currentcoupon, tradedate=startdate), key="dates")
notionals <- cdrmonthly[date>=startdate, lapply(.SD,function(x)cumprod(1-x/100*1/12)),
.SDcols=paste0("V",1:100)]
recovery <- as.matrix(recoverymonthly[date>=startdate, .SD, .SDcols=paste0("V",1:100)])*