aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/tranche_basket.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/tranche_basket.py')
-rw-r--r--python/analytics/tranche_basket.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index 1af37dd9..9554fbe0 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -590,8 +590,14 @@ class DualCorrTranche:
return
except ValueError as e:
warnings.warn(str(e))
- if "ref" in kwargs:
- ref = kwargs["ref"]
+ if "ref" in kwargs and self.index_type != "BS":
+ quotes = kwargs["ref"]
+ if isinstance(d, dict):
+ ref = quotes[(self.index_type, self.series, self.tenor)]
+ elif isinstance(quotes, float):
+ ref = quotes
+ else:
+ raise ValueError("don't know what to do with ref: {ref}")
else:
if not self.index_type == "BS":
col_ref = "close_price" if self.index_type == "HY" else "close_spread"