Re: Example of a simple option with Quantlib ?

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Example-of-a-simple-option-with-Quantlib-tp4400p4402.html

On 1/23/06, gilles herzog <[hidden email]> wrote:
> NB: in EuropeanOption, what means
> return std::exp(-r_*maturity_)
>                *PlainVanillaPayoff(type_, strike_)(s0_*std::exp(x))
>                *std::exp(-(x - nuT)*(x -nuT)/(2*sigma_*sigma_*maturity_))
>                /std::sqrt(2.0*M_PI*sigma_*sigma_*maturity_);
> in the operator().
> Why a PI ? why multiply the payoff with a exp ?

Gilles,
    forget that class. It's not used in the example. You might as well
delete it.

The rest of the example, i.e., the main() body, should give you some
hints on how to price an option. Write back if there are any problems.

Later,
    Luigi