• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

VBA code for Theta of a european Call

Joined
8/7/15
Messages
91
Points
18
I have been using so much time to make this function to work but I can't seem to find the problem. In world of no interest rate and no dividend I want to compute the theta of a call option

here is my code

Function theta(spot, strike, vol, T)

d1den = vol * Sqr(T)
d1num = Log(spot / strike) + (0.5 * vol ^ 2) * T
d1 = d1num / d1den

theta = -((spot * Application.NormDist(d1, 0, 1, False) * vol) / (2 * Sqr(T)))


What goes wrong here? I cant make it return any correct number.

for instance: spot = 100, strike = 105, vol = 0.1 and T =1 then the answer should be : -0.004965323. I can't replicate that number.
 
Back
Top