aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/cds_utils.R2
1 files changed, 1 insertions, 1 deletions
diff --git a/R/cds_utils.R b/R/cds_utils.R
index 640981ca..95dbca65 100644
--- a/R/cds_utils.R
+++ b/R/cds_utils.R
@@ -84,7 +84,7 @@ couponSchedule <- function(nextpaydate=NULL, maturity,
DC <- DiscountCurve(c(YC$params, list(dt=dt)),
YC$tsQuotes, yearFrac(YC$params$tradeDate, dates), YC$legparams)
- if(toupper(coupontype)=="FLOAT" && !is.na(margin)){
+ if(is.na(coupontype) || (toupper(coupontype)=="FLOAT" && !is.na(margin))){
## if is.na(margin) probably letter of credit
## we floor the coupon at the current gross rate
coupons <- pmax(currentcoupon, DC$forwards + margin)