{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#%matplotlib nbagg\n", "\n", "import os\n", "import sys\n", "sys.path.append(os.path.join(os.environ['CODE_DIR'], 'python', 'exploration'))\n", "sys.path.append(os.path.join(os.environ['CODE_DIR'], 'python'))\n", "import curve_trades as ct\n", "import matplotlib.pyplot as plt\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "index = 'IG'\n", "on_the_run = 28" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#On the run spread differences\n", "spreads_diff = ct.curve_spread_diff(index, on_the_run)\n", "spreads_diff.plot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Table of Spread Differences, and Z-score of current spread differences\n", "ct.spreads_diff_table(spreads_diff)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Theta per unit duration\n", "ct.theta_matrix_by_series(index, on_the_run)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#on the run theta\n", "ct.on_the_run_theta(index, on_the_run)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Curve Trade returns\n", "ct.curve_returns()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ct.cross_series_curve()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Theta with 3-5-10 Strategy\n", "theta_ratio_within_series = ct.theta_ratio_within_series()\n", "ct.curve_3_5_10(theta_ratio_within_series)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Theta with 5-10 Strategy\n", "ct.curve_5_10(theta_ratio_within_series)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }