{ "cells": [ { "cell_type": "markdown", "id": "8e5c727b", "metadata": {}, "source": [ "# Implied Future & Discount From Option Quotes\n", "\n", "This notebook computes the implied underlying future bid/ask from option quotes of a *single expiry*.\n", "\n", "* Computes an **implied future quote** $[F_{\\text{bid}}, F_{\\text{ask}}]$ and a **discount range** $[D_{\\min}, D_{\\max}]$ that are **jointly consistent** with the quoted calls & puts.\n", "* Identifies and **excludes the fewest possible strikes** whose quotes prevent any consistent solution (likely stale/misquoted lines).\n", "* Visualizes per-strike **implied future intervals** and the final $[F_{\\text{bid}}, F_{\\text{ask}}]$." ] }, { "cell_type": "code", "execution_count": null, "id": "a7950be2", "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.rcParams[\"figure.dpi\"] = 120\n", "\n", "from volkit import estimate_future_from_option_quotes\n", "from volkit.datasets import spxw" ] }, { "cell_type": "markdown", "id": "c7191e82", "metadata": {}, "source": [ "Read a set op example option quotes. Weekly S&P options with 7 days to expiry. Use only quotes that have been trades at least once (min_vol=1)" ] }, { "cell_type": "code", "execution_count": 2, "id": "3ecb31a6", "metadata": {}, "outputs": [], "source": [ "df = spxw(min_volume=1, D=7)" ] }, { "cell_type": "code", "execution_count": null, "id": "535154b7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| F | 2918.900000 |
|---|---|
| F_bid | 2918.600000 |
| F_ask | 2919.200000 |
| D | 0.999083 |
| D_min | 0.99066667 |
| D_max | 1.00750000 |