diff options
Diffstat (limited to 'python/risk/portfolio.py')
| -rw-r--r-- | python/risk/portfolio.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/python/risk/portfolio.py b/python/risk/portfolio.py index 2f4fb538..1e4a2f55 100644 --- a/python/risk/portfolio.py +++ b/python/risk/portfolio.py @@ -50,16 +50,14 @@ def build_portfolio(position_date, value_date=None, fund="SERCGMAST"): syn_portf += curve_portf + nocurve_portf # get bond risks: rmbs_pos = subprime_risk(position_date, conn, dbengine("rmbs_model"), fund=fund) - crt_pos = crt_risk( - position_date, conn, dbengine("crt"), fund=fund, model_version="hpi5_ir3_btm" - ) - # CRT model version changes with time, need to check - rmbs_notional = ( - rmbs_pos.get("hy_equiv", np.zeros(1)).sum() - + crt_pos.get("hy_equiv", np.zeros(1)).sum() + crt_pos = crt_risk(position_date, conn, dbengine("crt"), fund=fund) + portf.add_trade( + hy_equiv_trade(value_date, -rmbs_pos.get("hy_equiv", np.zeros(1)).sum()), + ("rmbs_bonds", "rmbs_bonds"), ) portf.add_trade( - hy_equiv_trade(value_date, -rmbs_notional), ("rmbs_bonds", "rmbs_bonds") + hy_equiv_trade(value_date, -crt_pos.get("hy_equiv", np.zeros(1)).sum()), + ("crt_bonds", "crt_bonds"), ) with dbconn("etdb") as etconn: clo_pos = clo_risk(position_date, conn, etconn, fund=fund) |
