Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.73 option_binary

Function File: [value] = option_binary (CallPutFlag, binary_type, S, X1, X2, T, r, sigma, divrate)

Compute the prices of European Binary call or put options according to Reiner and Rubinstein (Unscrambling the Binary Code, RISK 4 (October 1991), pp. 75-83) valuation formulas:

Option type Gap
A gap call option pays the difference (gap) between spot and either one of two strike values:

C(S,X1,X2,T) = X2*exp(-rT)*N(d)
P(S,X1,X2,T) = X2*exp(-rT)*N(-d)
d = (log(S/X1) + (r - divrate + 0.5*sigma^2)*T)/(sigma*sqrt(T))

Option type Cash-or-Nothing
A cash or nothing option pays the pre-defined amount X2 if the value is larger than the strike X1 (call option) or lower than the strike X1(put option):

C(S,X1,X2,T) = N(d)*X2*exp(-rT)
P(S,X1,X2,T) = N(-d)*X2*exp(-rT)
d = (log(S/X1) + (r - divrate - 0.5*sigma^2)*T)/(sigma*sqrt(T))

Option type Asset-or-Nothing
An asset or nothing option pays the future spot value S if the value is larger than the strike X1(call option) or lower than the strike X1 (put option):

C(S,X1,T) = S*N(d)*exp(-divrate*T)
P(S,X1,T) = S*N(-d)*exp(-divrate*T)
d = (log(S/X1) + (r - divrate + 0.5*sigma^2)*T)/(sigma*sqrt(T))

Option type Supershare
A supershare option has a payoff, if the future spot values lies between an lower bound X1 and upper bound X2, and is zero otherwise:

Value(S,X1,X2,T) = (S*exp(-divrate*T)/X1) * (N(d1) - N(d2))
d1 = (log(S/X1) + (r - divrate + 0.5*sigma^2)*T)/(sigma*sqrt(T))
d2 = (log(S/X2) + (r - divrate + 0.5*sigma^2)*T)/(sigma*sqrt(T))

All formulas are taken from Haug, Complete Guide to Option Pricing Formulas, 2nd edition, page 174ff.

Variables:

See also: option_willowtree, option_bs.


Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]