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.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py
index abc91bd7..b16c7217 100644
--- a/python/analytics/tranche_basket.py
+++ b/python/analytics/tranche_basket.py
@@ -1425,5 +1425,28 @@ class MarkitTrancheBasket(TrancheBasket):
class ManualTrancheBasket(TrancheBasket):
"""TrancheBasket with quotes manually provided"""
- def _set_tranche_quotes(self, value_date, tranche_quotes):
- self.tranche_quotes = tranche_quotes
+ def _set_tranche_quotes(self, value_date, ref, quotes):
+ if self.index_type == "HY":
+ detach = [15, 25, 35, 100]
+ elif self.index_type == "IG":
+ detach = [3, 7, 15, 100]
+ elif self.index_type == "EU":
+ detach = [3, 6, 12, 100]
+ else:
+ detach = [10, 20, 35, 100]
+ coupon = 500 if (self.index_type == "HY" or self.index_type == "XO") else 100
+ if self.index_type == "HY":
+ ref_type1 = "indexrefprice"
+ ref_type2 = "indexrefspread"
+ else:
+ ref_type1 = "indexrefspread"
+ ref_type2 = "indexrefprice"
+ self.tranche_quotes = pd.DataFrame(
+ {
+ "detach": np.array(detach),
+ "trancheupfrontmid": np.array(quotes),
+ "trancherunningmid": np.full(4, coupon),
+ ref_type1: np.full(4, ref),
+ ref_type2: np.full(4, None),
+ }
+ )