diff options
Diffstat (limited to 'python/notebooks/Reto Report.ipynb')
| -rw-r--r-- | python/notebooks/Reto Report.ipynb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/notebooks/Reto Report.ipynb b/python/notebooks/Reto Report.ipynb index c91cd918..6e62b252 100644 --- a/python/notebooks/Reto Report.ipynb +++ b/python/notebooks/Reto Report.ipynb @@ -159,17 +159,17 @@ "#Update manually - positive notional = long risk\n", "non_trancheSwap_risk_notional = 49119912 \n", "\n", - "portf.add_trade(CreditIndex('HY', on_the_run('HY'), '5yr', value_date = date, notional = -non_trancheSwap_risk_notional), 'port')\n", + "portf.add_trade(CreditIndex('HY', on_the_run('HY'), '5yr', value_date = date, notional = -non_trancheSwap_risk_notional), 'bond')\n", " \n", "portf.value_date = date\n", "portf.mark(interp_method=\"bivariate_linear\")\n", "portf.reset_pv()\n", - " \n", - "vs = BlackSwaptionVolSurface(portf.swaptions[0].index.index_type, \n", - " portf.swaptions[0].index.series, \n", - " value_date=date, \n", - " interp_method = \"bivariate_linear\")\n", - "vol_surface = vs[vs.list(option_type='payer')[-1]]\n", + "\n", + "vol_surface = {}\n", + "for trade in portf.swaptions:\n", + " vs = BlackSwaptionVolSurface(trade.index.index_type, trade.index.series, \n", + " value_date=date, interp_method = \"bivariate_linear\")\n", + " vol_surface[trade.index.index_type + trade.index.series] = vs[vs.list(option_type='payer')[-1]]\n", "vol_shock = [0]\n", "corr_shock = [0]\n", "spread_shock = widen + tighten\n", |
