diff options
Diffstat (limited to 'python/risk/tranches.py')
| -rw-r--r-- | python/risk/tranches.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/risk/tranches.py b/python/risk/tranches.py index 5bc0613a..aa967ad3 100644 --- a/python/risk/tranches.py +++ b/python/risk/tranches.py @@ -3,6 +3,7 @@ import logging logger = logging.getLogger(__name__) + def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): if by_strat: sql_string = "SELECT * from list_tranche_positions_by_strat(%s, %s)" @@ -27,7 +28,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): corr_attach=None, corr_detach=None) for t in trade_ids]) portf.trade_ids = [(tid.folder, - f"{t.index_type} {t.series} {t.tenor} {t.attach}-{t.detach}") + f"{t.index_type} {t.series} {t.tenor} {t.attach}-{t.detach}") for tid, t in zip(trade_ids, portf.trades)] else: portf = Portfolio([DualCorrTranche.from_tradeid(dealid) for _, dealid in trade_ids], @@ -36,6 +37,7 @@ def get_tranche_portfolio(date, conn, by_strat=False, fund="SERCGMAST"): portf.mark() return portf + def insert_tranche_portfolio(portf, conn): cols = ["clean_nav", "accrued", "duration", "delta", "gamma", "theta", "tranche_factor", "upfront", "running", |
