The Greeks Explained: Math & Code
If Black-Scholes is the engine, the Greeks are the dashboard. They tell you exactly how your PnL will change when key variables shift.
Key Concepts
Delta (Δ)
Change in Option Price / Change in Stock Price.
Interpretation: Roughly the probability needed to expire ITM.
Gamma (Γ)
Change in Delta / Change in Stock Price.
Interpretation: Acceleration or curvature of the PnL.
Theta (Θ)
Change in Option Price / Change in Time.
Interpretation: Cost of carry (rent) per day.
Vega (v)
Change in Option Price / Change in Volatility.
Interpretation: Sensitivity to implied volatility changes.
Calculating Greeks in Python
We can use scipy.stats.norm to implement the closed-form solutions for Black-Scholes Greeks.
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
Practical Usage in Interviews
Why is Vega highest At-The-Money (ATM)?
Because ATM options have the most "uncertainty". Deep ITM options act like stock (Delta 1, low Vega). Deep OTM options act like nothing (Delta 0, low Vega). Only when you are ATM does a change in volatility drastically change the probability of finishing ITM.
What happens to Gamma as expiration approaches?
For ATM options, Gamma explodes towards infinity as $T \to 0$. Why? Because a tiny move in the stock price can instantly flip your Delta from 0 to 1 (or vice versa) if you are right at the strike at 3:59 PM on expiration Friday. This is called "Pin Risk".