defining payoff of basket option

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

defining payoff of basket option

Eye Doc
 
I would like to know how I can define a payoff function for a basket opion.
I want to price a simple basket option (call / put) on the arithmetic mean of the components.
 
I have tried 
 
Option.Type optionType = Option.Type.Call;

EuropeanExercise europeanExercise = new EuropeanExercise(maturityDate); 

PlainVanillaPayoff payoffCallBask = new PlainVanillaPayoff(optionType, strikePrice);

BasketOption

baskOption = new BasketOption(payoffCallBask, europeanExercise);
but get the message: "wrong payoff given"

(I am just learning how to use Quanlib. I use Quantlib in C# via SWIG. 
 
regards,
Bastiaan

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: defining payoff of basket option

Luigi Ballabio
On Mon, 2008-12-08 at 10:33 +0100, Eye Doc wrote:
>  
> I would like to know how I can define a payoff function for a basket
> opion.
> I want to price a simple basket option (call / put) on the arithmetic
> mean of the components.

You'll have to use AverageBasketPayoff, instead of passing a
PlainVanillaPayoff to the option. Something like:

PlainVanillaPayoff payoffCall = new PlainVanillaPayoff(optionType,
strikePrice);

BasketPayoff payoffBask = new AverageBasketPayoff(payoffCall, N);

BasketOption baskOption = new BasketOption(payoffBask,
europeanExercise);

where N is the number of instruments in the basket.

Luigi



--

Everything that can be invented has been invented.
-- Charles Duell, Director of U.S. Patent Office, 1899



------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users