LIVE
connecting to the live quote stream…
--:--:--UTC
mediumTrading○
← prevnext →
#48

Theta bleed to expiry

mediumTradingacceptance —~20 min

Implement theta_bleed(S, K, r, sigma, days, day_count) — how much a European call loses to time over one day: price it with Black-Scholes at T = days / day_count and again at T = (days - 1) / day_count, and return [value_now, value_tomorrow, bleed] where bleed = value_now - value_tomorrow. Use N from statistics.NormalDist.

Theta is the rent an option buyer pays every night, and it is quoted per calendar day or per trading day depending on who you ask — the day_count parameter is that choice. Return the three values rounded to 4 decimal places.

example 1
input
S=100.0, K=100.0, r=0.05, sigma=0.2, days=30, day_count=365
output
[2.4934, 2.4481, 0.0453]
example 2
input
S=100.0, K=100.0, r=0.05, sigma=0.2, days=30, day_count=252
output
[3.0512, 2.995, 0.0562]
note

Same option, quoted on a 252-day year: the bleed per day is larger.

constraints
  • 0 < S, K ≤ 10_000
  • 2 ≤ days ≤ 365
  • day_count ∈ {252, 365}
teacher · 2 hints · the first is free
↗ read the theory
the chapter this problem is cut from
▶ open in the workbench
run the same math on a real tape
●solution.py· utf-8 · spaces:4
ln 1, col 1tab indent · esc leave editor
python 3.13 · pyodide
+ 6 hidden on submit
input · keyword arguments to theta_bleed()
S=100.0, K=100.0, r=0.05, sigma=0.2, days=30, day_count=365
expected
[2.4934, 2.4481, 0.0453]

the judge calls theta_bleed() with exactly these inputs · outputs are compared to 6 decimal places

● standing bypython 3.13 in your browser · pyodide 0.28.3 · judged on the server to 6 dp⌘↵ run · ⌘⇧↵ submit
paper only · educational · not advice