{"repo":"vivek-v-rao/Delta-Gamma","free":true,"listed":false,"github":"https://github.com/vivek-v-rao/Delta-Gamma","clone":"git clone https://github.com/vivek-v-rao/Delta-Gamma.git","description":"Piecewise quadratic approximation to the Black-Scholes value of a straddle vs. stock price","language":"Python","stars":15,"topics":["black-scholes","option-pricing","quantitative-finance"],"license":"MIT","category":"trading","readme_excerpt":"Delta-Gamma Delta-Gamma is a small Python project that compares fast, scenario-based PnL approximations for an at-the-money (ATM) option straddle against exact Black-Scholes repricing. The goal is to keep the simplicity of a local delta-gamma (second-order Taylor) approximation near the current spot, while preventing the unrealistic quadratic blow-up in large moves by switching to linear tails. What it computes Given a current spot S0 and an ATM straddle (1 call + 1 put, same strike K and maturity T), the script builds a pandas DataFrame across a grid of spot scenarios S: - pnl exact bs Exact PnL from repricing the straddle with Black-Scholes at each S and subtracting the initial value at S0. - pnl delta gamma Local second-order Taylor approximation about S0: pnl(S) = delta0 (S-S0) + 0.5 gamma0 (S-S0)^2 - pnl piecewise clip C1 piecewise quadratic/linear proxy: - quadratic in the middle (same formula as pnl delta gamma) - linear in the tails with slopes clipped to the natural straddle delta limits [-1, +1] The linear regions start where the linearized delta hits the bounds: x L = (delta L - delta0)/gamma0, x R = (delta R - delta0)/gamma0 S L = S0 + x L, S R = S0 + x R For an ATM straddle, delta L=-1, delta R=+1 (and typically delta0 is near 0). - pnl piecewise fit bs Same piecewise quadratic/linear shape, but the join points (S L, S R) are chosen so that the piecewise model matches Black-Scholes PnL at the joins while keeping the tail slopes fixed. This usually improves tail a","default_branch":null,"files":null,"tree":[],"storefront":"/r/vivek-v-rao","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vivek-v-rao/Delta-Gamma/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}