Payoffs

Payoffs are defined in FinancialMonteCarlo.jl. Every method prices the following ones; any other payoff, such as a barrier option, raises a MethodError.

PayoffConstructorResult
European optionEuropeanOption(T, K, iscall = true)number
Binary optionBinaryEuropeanOption(T, K, iscall = true)number
Smile of European optionsFinancialMonteCarlo.EuropeanOptionSmile(T, Ks, iscalls)vector, one price per strike
Smile of binary optionsFinancialMonteCarlo.BinaryEuropeanOptionSmile(T, Ks, iscalls)vector, one price per strike

Single options

pricer(model, zero_rate, method, EuropeanOption(1.0, 105.0)), pricer(model, zero_rate, method, BinaryEuropeanOption(1.0, 105.0, false))
(6.234595809498316, 0.6034125169635123)

Smiles

A smile has one maturity and several strikes, each with its own call or put flag. This is how to price several strikes: pricer does not take a vector of strikes.

smile = FinancialMonteCarlo.EuropeanOptionSmile(1.0, [90.0, 100.0, 110.0], [false, true, true])
pricer(model, zero_rate, method, smile)
3-element Vector{Float64}:
 3.26459552027899
 8.34940576709677
 4.564243161927735
smile = FinancialMonteCarlo.BinaryEuropeanOptionSmile(1.0, [90.0, 100.0, 110.0], [false, true, true])
pricer(model, zero_rate, method, smile)
3-element Vector{Float64}:
 0.3104792577414433
 0.4705553456232836
 0.2933271471028047

Different maturities

Options with different maturities are priced by broadcasting, and pricer does not take an array of options.

options = [EuropeanOption(0.5, 100.0), BinaryEuropeanOption(1.0, 105.0), EuropeanOption(2.0, 110.0, false)]
pricer.(model, zero_rate, method, options)
3-element Vector{Float64}:
  5.846717440697091
  0.376786156343243
 15.68895110489764

Puts

Every price is computed as a call and converted to a put through the put–call parity, so calls and puts share their accuracy, and their cost when they are in the same smile.