aboutsummaryrefslogtreecommitdiffstats
path: root/python/notebooks/Allocation Reports.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'python/notebooks/Allocation Reports.ipynb')
-rw-r--r--python/notebooks/Allocation Reports.ipynb9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/notebooks/Allocation Reports.ipynb b/python/notebooks/Allocation Reports.ipynb
index b20f77d0..e64b84b0 100644
--- a/python/notebooks/Allocation Reports.ipynb
+++ b/python/notebooks/Allocation Reports.ipynb
@@ -245,8 +245,8 @@
"outputs": [],
"source": [
"#Positions and Risks\n",
- "rmbs_pos = go.get_rmbs_pos_df()\n",
- "clo_pos = go.get_clo_pos_df()"
+ "rmbs_pos = go.hist_pos(asset_class = 'rmbs')\n",
+ "clo_pos = go.hist_pos(asset_class = 'clo')"
]
},
{
@@ -302,8 +302,9 @@
"#RMBS Risk - need RMBS Positions and Risks\n",
"sql_string = \"select date, duration, series from on_the_run where index = 'HY'\"\n",
"duration = pd.read_sql_query(sql_string, Sengine, parse_dates=['date'], index_col=['date'])\n",
- "df = pd.merge_asof(rmbs_pos.sort_index(), duration, left_index=True, right_index=True)\n",
- "rmbs_hy_equiv = df.groupby('timestamp').apply(lambda df: sum(df.delta_yield/df.duration * 100))\n",
+ "rmbs_pos = pd.merge_asof(rmbs_pos.sort_index(), duration, left_index=True, right_index=True)\n",
+ "rmbs_pos['hy_equiv'] = rmbs_pos.delta_yield/rmbs_pos.duration * 100\n",
+ "rmbs_pos.groupby('timestamp').sum()\n",
"#hy_equiv.plot()"
]
},