Greek Surfaces

This notebook visualizes option Greeks as surfaces over strike and time.

%matplotlib inline
import matplotlib.pyplot as plt
plt.rcParams["figure.dpi"] = 120

import numpy as np
from volkit import (
    price_euro_future, 
    delta_euro_future, 
    gamma_euro_future, 
    theta_euro_future,
    vega_euro_future,
    rho_euro_future,
    dual_delta_euro_future,
    vanna_euro_future,
    vomma_euro_future,
    lambda_euro_future,
)

F = 100.0
r = 0.01
sigma = 0.2
cp = "call"

K = np.linspace(60, 140, 50)
T = np.linspace(0.01, 2.0, 50)
KK, TT = np.meshgrid(K, T)

Price = price_euro_future(F, KK, TT, r, sigma, cp)
Delta = delta_euro_future(F, KK, TT, r, sigma, cp)
Gamma = gamma_euro_future(F, KK, TT, r, sigma, cp)
Theta = theta_euro_future(F, KK, TT, r, sigma, cp)
Vega = vega_euro_future(F, KK, TT, r, sigma, cp)
Rho = rho_euro_future(F, KK, TT, r, sigma, cp)
DualDelta = dual_delta_euro_future(F, KK, TT, r, sigma, cp)
Vanna = vanna_euro_future(F, KK, TT, r, sigma, cp)
Vomma = vomma_euro_future(F, KK, TT, r, sigma, cp)
Lambda = lambda_euro_future(F, KK, TT, r, sigma, cp)

Price Surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Price, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Price")
ax.set_title("Price surface")
plt.show()
plt.close(fig)
../_images/f5aa1715401d0522134b1ed45059bd4b1024fea7de77b4be098fb84c405125ff.png

Delta Surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Delta, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Delta")
ax.set_title("Delta surface")
plt.show()
plt.close(fig)
../_images/aee03aa1318bcf8e00c5c7ae1d2846b06259ce9634923fc82ae699e3154ce41c.png

Gamma surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Gamma, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Gamma")
ax.set_title("Gamma surface")
plt.show()
plt.close(fig)
../_images/810ee9359a7cac8c6d959bb098016d9d868f6fcab83cf9c8939a825007c6868d.png

Theta surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Theta, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Theta")
ax.set_title("Theta surface")
plt.show()
plt.close(fig)
../_images/bd8414a23d8c085ebdabb05081f39544914bf90f729aab489f16c21497bd6077.png

Vega surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Vega, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Vega")
ax.set_title("Vega surface")
plt.show()
plt.close(fig)
../_images/24766b54d084fcc738941b972822304497b7c692c5669b400c2db61b0c35bfee.png

Rho surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Rho, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Rho")
ax.set_title("Rho surface")
plt.show()
plt.close(fig)
../_images/f2ad87c379a0a1b8c5316a033fd5b225eefad1d4b792bd2db0167a0ac2b0996c.png

Dual Delta surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, DualDelta, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Dual Delta")
ax.set_title("Dual Delta surface")
plt.show()
plt.close(fig)
../_images/d1632473698e6ae8e22edb075fe3cff2be4f98206e57712aa337f83936dbd65a.png

Vanna surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Vanna, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Vanna")
ax.set_title("Vanna surface")
plt.show()
plt.close(fig)
../_images/d1eb61d59267ae577ad96228ed8b9d7c2e76676a2799a2a82e9ea7ddc37e321f.png

Vomma surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Vomma, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Vomma")
ax.set_title("Vomma surface")
plt.show()
plt.close(fig)
../_images/0b4557f2dcdd17f9aedc229f747dbba92e9ad262e41d0e2ec87e25fbca54082c.png

Lambda surface

fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")
ax.plot_surface(KK, TT, Lambda, cmap="viridis", edgecolor="none")
ax.set_xlabel("Strike K")
ax.set_ylabel("Time T (years)")
ax.set_zlabel("Lambda")
ax.set_title("Lambda surface")
plt.show()
plt.close(fig)
../_images/2969f12f721a14754434b71757a3fc3cad6c831a3293206bd299e396b745b66b.png