Re: Multi-asset options

Posted by Wujiang Lou on
URL: http://quantlib.414.s1.nabble.com/Multi-asset-options-tp2771p2779.html

What about some other idea like this:

//state is a vector of double
template <int N=1>
class State<N>;

//class D is a date, in years (double), in num of days( int), and your Date
class.
// A path is a function mapping time D to State<N>.
template <class D, int N=1>
class Path;

template<class D, int N>
class Payoff
{
public:
 virtual ~Payoff() {}
 virtual double operator()(D t, const State<N> & s) const = 0;
 virtual double operator()(D t, const Path<D, N>& p) const = 0;
};

Cheers,


Ferdinando Ametrano wrote:

> Hi all
>
> it seems like we all agree. Sorry if my first reply was not clear enough.
>
> The idea is that as long as I can calculate the payoff:
>
>     double value = payoff(f(...));
>
> the current Payoff classes are ok.
>
> The f function could be max, min, average, whatever, with as many arguments
> you need.
>
> ciao -- Nando
>
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

--
This is not an offer (or solicitation of an offer) to buy/sell the
securities/instruments mentioned or an official confirmation.  Morgan Stanley
may deal as principal in or own or act as market maker for
securities/instruments mentioned or may advise the issuers.  This may refer to
a research analyst/research report. Unless indicated, these views are the
author's and may differ from those of Morgan Stanley research or others in the
Firm. We do not represent this is accurate or complete and we may not update
this.  Past performance is not indicative of future returns. For additional
information, research reports and important disclosures, contact me or see
https://secure.ms.com.  You should not use email to request, authorize or
effect the purchase or sale of any security or instrument, to send transfer
instructions, or to effect any other transactions.  We cannot guarantee that
any such requests received via email will be processed in a timely manner.
This communication is solely for the addressee(s) and may contain confidential
information.  We do not waive confidentiality by mistransmission.  Contact me
if you do not wish to receive these communications.  In the UK, this
communication is directed in the UK to those persons who are market
counterparties or intermediate customers (as defined in the UK Financial
Services Authority's rules).