Example of a simple option with Quantlib ?

Posted by gilles herzog on
URL: http://quantlib.414.s1.nabble.com/Example-of-a-simple-option-with-Quantlib-tp4400.html

Good afternoon,
I just want to price a simple option with quantlib
I know the maturity, the strike, s0, Sigma and r and I want to use Black and
scholes.
It must be very easy to do that with Quantlib but the example
europeanOption.cpp causes a lot of problems to me.
Could someone give me a simple example ??
Thank you very much

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 ?

_________________________________________________________________
http://desktop.msn.fr/