期權
派生美式期權隱含波動率的修正二等分公式
我正在嘗試制定計算派息股票的美式期權隱含波動率(離散支付或年化收益率)的公式。
為二分法算法提供了以下程式碼,並附有註釋:“稍作修改,該函式也可用於查找美式和奇異期權的隱含波動率”。但是,我無法在書中(或線上)中找到更多資訊,其中提供了有關所需修改的說明。
我包括下面的功能程式碼,希望有人可以提出所需的修改:
function BisectionAlgorithm(CallPutFlag As String, S As Double, X as Double, T As Double, r As Double, b as Double, cm As Double) As Double Dim vLow as Double, vHigh As Double, vi as Double Dim cLow As Double, cHigh As Double, epsilon as Double, tempval As Double vLow=0.01 vHigh=1 epsilon=0.000001 cLow = GBlackScholes(CallPutFlag,S,X,T,r,b,vLow) cHigh = GBlackScholes(CallPutFlag,S,X,T,r,b,vHigh) vi=vLow+(cm-cLow)*(vHigh-vLow)/(cHigh-cLow) tempval=GBlackScholes(CallPutFlag,S,X,T,r,b,vi) While Abs(cm-tempval) > epsilon if tempval < cm Then vLow=vi Else vHigh=vi End If cLow = GBlackScholes(CallPutFlag,S,X,T,r,b,vLow) cHigh = GBlackScholes(CallPutFlag,S,X,T,r,b,vHigh) vi=vLow+(cm-cLow)*(vHigh-vLow)/(cHigh-cLow) tempval=GBlackScholes(CallPutFlag,S,X,T,r,b,vi) Wend BisectionAlgorithm=vi End Function
算法是相同的,您只需要使用適當的(美國/異國情調)定價器而不是 black-scholes。