diff options
Diffstat (limited to 'python/notebooks/Curve cap.ipynb')
| -rw-r--r-- | python/notebooks/Curve cap.ipynb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/python/notebooks/Curve cap.ipynb b/python/notebooks/Curve cap.ipynb index 4ce1f2f6..1a42524e 100644 --- a/python/notebooks/Curve cap.ipynb +++ b/python/notebooks/Curve cap.ipynb @@ -58,6 +58,28 @@ "execution_count": null, "metadata": {}, "outputs": [], + "source": [ + "with init_bbg_session(BBG_IP) as session:\n", + " hist_data_210 = retrieve_data(session, [\"USSW2 Curncy\", \"USSW10 Curncy\"], [\"PX_LAST\"], start_date=pd.datetime(1994, 1, 1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "df = pd.concat(hist_data).unstack(level=0)\n", + "df.columns = ['2y_swap', '10y_swap']\n", + "df['diff'] = df['10y_swap'] - df['2y_swap']\n", + "df.plot(title='Historical swap rates')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [] } ], @@ -77,7 +99,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.7.0" } }, "nbformat": 4, |
