aboutsummaryrefslogtreecommitdiffstats
path: root/R/calibration.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/calibration.R')
-rw-r--r--R/calibration.R3
1 files changed, 3 insertions, 0 deletions
diff --git a/R/calibration.R b/R/calibration.R
index c16cdaca..9c0e9b2d 100644
--- a/R/calibration.R
+++ b/R/calibration.R
@@ -71,6 +71,9 @@ set.tranchedata <- function(index, tradedate){
defaultleg(index$cs, sc, index$recovery, startdate)
index$quotes$price <- 1 + cds.pv - cdsAccrued(tradedate, index$quotes$spread[1])
}
+ if(length(indexpv(index, tradedate=tradedate, check=TRUE))==1){
+ return(NULL)
+ }
tweak <- tweakcurves(index, tradedate)
index$portfolio <- NULL
index <- c(index, tweak)