VBA BS选项函数语法错误

VBA BS Option function syntax error

我正在尝试使用 VBA:

编写一个 BS 期权看涨价值函数
Function BSCallValue(S, K, r, q, tyr, Sigma)
' returns black-scholes call value (allowing for q=div yld)
Dim ert, qrt
Dim DOne, DTwo, NDOne, NDTwo
ert = Exp(-r * tyr)
qrt = Exp(-q * tyr)

DOne = (Log(S / K) + (r - q + 0.5 * Sigma^2) * tyr) / (Sigma * Sqr(tyr))
DTwo = (Log(S / K) + (r - q - 0.5 * Sigma^2) * tyr) / (Sigma * Sqr(tyr))
NDOne = Application.Norm_S_Dist(DOne)
NDTwo = Application.Norm_S_Dist(DTwo)

BSCallValue = (S * qrt * NDOne - K * ert * NDTwo)


End Function

但是 DOne 和 DTwo 行一直给我 'syntax error'。

这有什么问题吗?

Norm_S_Dist 需要两个参数。使用,

NDOne = Application.Norm_S_Dist(DOne, true)
NDTwo = Application.Norm_S_Dist(DTwo, false)

NORM.S.DIST(z,cumulative)
 
The NORM.S.DIST function syntax has the following arguments:
 
Z (Required) The value for which you want the distribution.
Cumulative (Required) Cumulative is a logical value that determines the form of the function. If cumulative is TRUE, NORMS.DIST returns the cumulative distribution function; if FALSE, it returns the probability mass function.