0DTE Index Options Microstructure: Dealer Gamma Exposure (GEX), Vanna, and Charm Flows in Python

2026-10-23来源 dev.to PythonEnglish

Canonical Research Note: Originally published by the TrendSpike Institutional Systems & Quantitative Finance Desk. Full Black-Scholes-Merton second-order Greek derivations and dealer hedging matrices are available in the primary publication.

Python Implementation: Black-Scholes 0DTE Gamma, Vanna & Charm Engine

 python import math def norm_pdf(x: float) -> float: return math.exp(-0.5 * x * x) / math.sqrt(2.0 * math.pi) def compute_0dte_greeks(spot: float, strike: float, iv: float, minutes_left: float, rate: float = 0.05) -> dict: tau = max(minutes_left / (252.0 * 390.0), 1e-6) sqrt_tau = math.sqrt(tau) d1 = (math.log(spot / strike) + (rate + 0.5 * iv * iv) * tau) / (iv * sqrt_tau) d2 = d1 - iv * sqrt_tau pdf_d1 = norm_pdf(d1) gamma = pdf_d1 / (spot * iv * sqrt_tau) vanna = -pdf_d1 * (d2 / iv) charm = pdf_d1 * ((2.0 * rate * tau - d2 * iv * sqrt_tau) / (2.0 * tau * iv * sqrt_tau)) return { "gamma": round(gamma, 6), "vanna": round(vanna, 6), "charm_daily": round(charm / 252.0, 6), } 

原文:https://www.a8q9.cn/en/article/0dte-index-options-microstructure-dealer-gamma-exposure-gex-vanna-and-charm-flow-aec4ab.html

相关文章