请问为什么使用Excel VBA计算期权Option Greek的函数,返回值为#VALUE!

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

临摹微笑
浏览 249回答 1
1回答

跃然一笑

BSDOne可能是调用的另外的自定义函数,计算过程未知,没办法帮你调试,你还是自己检查下参数的输入把,对照BSDOne函数的要求看下,期权这玩意专业性太强了,实在帮助不到你
打开App,查看更多内容
随时随地看视频慕课网APP