更多请下载excel
一、BS计算Opt
1、打开一个空白Excel工作表,打开VBA编辑器(点击菜单:工具 -> 宏 -> Visual Basic编辑器):
2、插入模块(点击VBA编辑器菜单:插入 -> 模块):
3、将以下代码复制/粘贴到代码窗口中:
Function CallOpt(stock, exercise, maturity, rate, volatility) As Double
D1 = (Log(stock / exercise) + (rate + (volatility ^ 2) / 2) * maturity) / (volatility * Sqr(maturity))
D2 = D1 - volatility * Sqr(maturity)
CallOpt = stock * Application.NormSDist(D1) - exercise * Exp(-rate * maturity) * Application.NormSDist(D2)
|
|