Function BSOptionDelta(iopt, S, X, r, q, tyr, sigma)
'iopt is the option type, 1 is call, -1 is put
'X is the exercise price
'r is the risk free rate
'rfgn is the foreign interest rate, similar with the divident rate
'tyr is the option life or maturity
'sigma is the standard deviation of option
Dim eqt, c, c1, c1d, c2, d, g As Double
'd is the value of delta
'g is the value of gamma
'c is the option value
'c1 is N(d1)
'c2 is N(d2)
'c1d is the N'(d1)
eqt = Exp(-q * tyr)
c = BSOptionV.BSOptionValue(iopt, S, X, r, q, tyr, sigma)
c1 = Application.NormSDist(iopt * BSDOne(S, X, r, q, tyr, sigma))
c1d = BlackScholesNdashOne.BSNdashDOne(iopt, S, X, r, q, tyr, sigma)
c2 = Application.NormSDist(iopt * BSDTwo(S, X, r, q, tyr, sigma))
d = iopt * eqt * c1
g = eqt * c1d / (S * sigma * Sqr(tyr))
BSOptionDelta = d
End Function
跃然一笑