diff options
Diffstat (limited to 'python/notebooks')
| -rw-r--r-- | python/notebooks/Curve Trades.ipynb | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/python/notebooks/Curve Trades.ipynb b/python/notebooks/Curve Trades.ipynb index 5d1a1bec..6042ccc6 100644 --- a/python/notebooks/Curve Trades.ipynb +++ b/python/notebooks/Curve Trades.ipynb @@ -94,7 +94,7 @@ "outputs": [], "source": [ "#Theta with 3-5-10 Strategy\n", - "theta_ratio_within_series = ct.theta_ratio_within_series()\n", + "theta_ratio_within_series = ct.ratio_within_series(param = 'duration')\n", "ct.curve_3_5_10(theta_ratio_within_series)" ] }, @@ -113,6 +113,46 @@ "execution_count": null, "metadata": {}, "outputs": [], + "source": [ + "#Relative Spread Difference\n", + "spread_ratio = ct.ratio_within_series(param = 'closespread')\n", + "spread_ratio.groupby(level = ['date']).last()['closespread_ratio_to_5yr'].plot()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "model = ct.curve_model()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ax = model[['ratio','predicted']].plot()\n", + "ax.plot(model.index, model.up_2_stdev, 'r--')\n", + "ax.plot(model.index, model.down_2_stdev, 'b--')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "model.iloc[-1]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [] } ], |
