经管之家送您一份
应届毕业生专属福利!
求职就业群
感谢您参与论坛问题回答
经管之家送您两个论坛币!
+2 论坛币
<p><span style="COLOR: rgb(0,153,0);">****************************************************************************</span></p><p><span style="COLOR: rgb(0,153,0);">'* Cumulative Standard Normal Distribution *</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'* (This function provides similar result as NORMSDIST( ) on Excel) *</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'****************************************************************************</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">Function SNorm(z)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c1 = 2.506628</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c2 = 0.3193815</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c3 = -0.3565638</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c4 = 1.7814779</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c5 = -1.821256</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c6 = 1.3302744</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> If z > 0 Or z = 0 Then</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> w = 1</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Else: w = -1</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> End If</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> y = 1 / (1 + 0.2316419 * w * z)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> SNorm = 0.5 + w * (0.5 - (Exp(-z * z / 2) / c1) * _</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> (y * (c2 + y * (c3 + y * (c4 + y * (c5 + y * c6))))))</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> </span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">End Function<br/><br style="COLOR: rgb(51,51,255);"/></span><span style="COLOR: rgb(0,153,0);">'**********************************************************************</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'* Black-Scholes European Call Price Computation *</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'**********************************************************************</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">Function Call_Eur(s, x, t, r, sd)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim a As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim b As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim c As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim d1 As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim d2 As Single</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> a = Log(s / x)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> b = (r + 0.5 * sd ^ 2) * t</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c = sd * (t ^ 0.5)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> d1 = (a + b) / c</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> d2 = d1 - sd * (t ^ 0.5)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Call_Eur = s * SNorm(d1) - x * Exp(-r * t) * SNorm(d2)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> </span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">End Function</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(0,153,0);">'*********************************************************************</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'* Black-Scholes European Put Price Computation *</span><br style="COLOR: rgb(0,153,0);"/><span style="COLOR: rgb(0,153,0);">'*********************************************************************</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">Function Put_Eur(s, x, t, r, sd)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim a As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim b As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim c As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim d1 As Single</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Dim d2 As Single</span><br style="COLOR: rgb(51,51,255);"/><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> a = Log(s / x)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> b = (r + 0.5 * sd ^ 2) * t</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> c = sd * (t ^ 0.5)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> d1 = (a + b) / c</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> d2 = d1 - sd * (t ^ 0.5)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> CallEur = s * SNorm(d1) - x * Exp(-r * t) * SNorm(d2)</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> Put_Eur = x * Exp(-r * t) - s + CallEur</span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);"> </span><br style="COLOR: rgb(51,51,255);"/><span style="COLOR: rgb(51,51,255);">End Function</span><br style="COLOR: rgb(51,51,255);"/><br/><span style="COLOR: rgb(51,51,255);"><br/></span><span style="COLOR: rgb(51,51,255);"></span><br style="COLOR: rgb(51,51,255);"/><br/></p>
扫码加我 拉你入群
请注明:姓名-公司-职位
以便审核进群资格,未注明则拒绝
|