aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/risk/portfolio.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/python/risk/portfolio.py b/python/risk/portfolio.py
index 1c7eca0d..5996fbd0 100644
--- a/python/risk/portfolio.py
+++ b/python/risk/portfolio.py
@@ -16,7 +16,13 @@ from pandas.tseries.offsets import BDay
def hy_equiv_trade(value_date, notional):
- return CreditIndex("HY", on_the_run("HY", value_date), "5yr", value_date, notional)
+ return CreditIndex(
+ "HY",
+ on_the_run("HY", value_date),
+ "5yr",
+ value_date=value_date,
+ notional=notional,
+ )
def build_portfolio(position_date, value_date=None, fund="SERCGMAST"):
@@ -59,7 +65,11 @@ def build_portfolio(position_date, value_date=None, fund="SERCGMAST"):
("curve_trades", "curve_trades"),
)
- syn_portf += curve_portf + nocurve_portf
+ if not curve_portf:
+ syn_portf = nocurve_portf
+ else:
+ 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)