diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/cds_rebook.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/python/cds_rebook.py b/python/cds_rebook.py index f6d39bb7..46d7583e 100644 --- a/python/cds_rebook.py +++ b/python/cds_rebook.py @@ -88,6 +88,15 @@ PORTFOLIO = { } +def desc_str(index_type, series): + if index_type in ("IG", "HY", "HYBB"): + return f"CDX {index_type} CDSI S{series} 5Y" + elif index_type == "XO": + return f"ITRX XOVER CDSI S{series} 5Y" + elif index_type == "EU": + return f"ITRX EUR CDSI S{series} 5Y" + + def rebook(conn, trade_date, company_id, seniority, fcm, fund="SERCGMAST"): dawndb = dbconn("dawndb") upfront_settle_date = trade_date + 3 * BDay() @@ -126,7 +135,7 @@ def rebook(conn, trade_date, company_id, seniority, fcm, fund="SERCGMAST"): "frequency": 4, "protection": index_old.direction, "security_id": r.security_id, - "security_desc": f"CDX {index_old.index_type} CDSI S{index_old.series} 5Y", + "security_desc": desc_str(index_old.index_type, index_old.series), "upfront": index_old.pv, "upfront_settle_date": upfront_settle_date, "swap_type": "CD_INDEX", |
