Hi,

WIll the following UDFs be of any help?

Function BScdelta(S As Double, K As Double, sigma As Double, Time As Double, _

IntRate As Double) As Double

Dim indata As Variant

indata = BScgreeks(S, K, sigma, Time, IntRate)

BScdelta = indata(1, 2)

End Function

Function BScgreeks(S As Double, K As Double, sigma As Double, Time As Double, _

IntRate As Double) As Variant

Dim d1 As Double, d2 As Double, Nd1 As Double, Nd2 As Double

Dim N1d1 As Double

Dim Kr As Double, outdata(1, 6) As Double, srt As Double

srt = sigma * Sqr(Time)

Kr = K * Exp(-IntRate * Time)

d1 = Log(S / Kr) / srt + srt / 2

d2 = d1 - srt

Nd1 = Application.WorksheetFunction.NormSDist(d1)

Nd2 = Application.WorksheetFunction.NormSDist(d2)

N1d1 = 1 / Sqr(2 * Application.WorksheetFunction.Pi()) * Exp(-d1 * d1 / 2)

outdata(1, 1) = S * Nd1 - Kr * Nd2

outdata(1, 2) = Nd1

outdata(1, 3) = N1d1 / (S * srt)

outdata(1, 4) = -(S * N1d1 * srt / (2 * Time) + IntRate * Kr * Nd2)

outdata(1, 5) = S * Sqr(Time) * N1d1

outdata(1, 6) = Time * Kr * Nd2

BScgreeks = outdata

End Function

## Like this thread? Share it with others