Build a discrete-time delta-hedging engine, decompose its P&L into theta and gamma, find the cost-optimal rebalancing frequency, then watch the Black-Scholes hedge break under jumps and stochastic volatility. The capstone project for the Stochastic Calculus module.
stochastic-calculus · options · delta-hedging · black-scholes · monte-carlo · risk
Learners placed at Morgan Stanley NYC · Optiver AMS
A working delta-hedging engine, built section by section - hands-on, but never alone. Theory first, then you implement it, and checkpoints confirm each section clicked before the next one opens.
Never stuck
Reveal a hint when you want a nudge - or the full worked solution when you want the answer. Every exercise ships one.
Theory before code
Each formula is explained step by step before you implement it. Nothing is assumed mid-build.
Yours to keep
Finish with the complete research notebook - keep extending it with your own data.
Real code from inside the project. Press Run to replicate an option with 4 rebalances, then 52 - and watch the error collapse. Open this page on desktop to run it live in your browser.
import numpy as np
from math import erf, exp, log, sqrt
S0, K, T, sigma = 100.0, 100.0, 0.25, 0.20
N = lambda x: 0.5 * (1 + erf(x / sqrt(2)))
def delta(S, t):
if t <= 1e-9:
return 1.0 if S > K else 0.0
d1 = (log(S / K) + 0.5 * sigma ** 2 * t) / (sigma * sqrt(t))
return N(d1)
rng = np.random.default_rng(5)
def replication_error(steps):
dt = T / steps
S, pos = S0, delta(S0, T)
cash = -pos * S0
for i in range(1, steps + 1):
S *= exp(-0.5 * sigma ** 2 * dt + sigma * sqrt(dt) * rng.standard_normal())
d = delta(S, T - i * dt)
cash -= (d - pos) * S
pos = d
return pos * S + cash - max(S - K, 0)
for n in (4, 52):
errs = [replication_error(n) for _ in range(200)]
print(f"rehedge {n:>2}x over the option's life: error sd {np.std(errs):.2f} per option")
print()
print("hedging more often shrinks the error - but every rebalance costs money")The full build prices the whole trade-off: replication error against real trading costs.
Resume bullets
Copy-paste ready - with the build behind you to back every line.
2 more resume bullets inside the project
Interview ammo
“Why is a delta-hedged long option position long gamma and short theta?”
You answer this with a system you built, not a definition you memorized.
4 more talking points inside the project
Full access to this build and the rest of the pipeline - every project in the vault, plus the lessons, exams and certificates behind them. Guided from the first line to the last.
~12h build · +400 XP · 3 resume bullets · 5 interview answers