Re: How to obtain the Greeks

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/How-to-obtain-the-Greeks-tp11547p11548.html

On Wed, 2008-01-09 at 13:34 +0000, Ibrahim El-Fayoumi wrote:

> Hello Luigi
> When I tried to use the example with package to obtain the greeks,
> I did the following:
> ......
> // options
>         VanillaOption europeanOption(payoff, europeanExercise);
>         VanillaOption bermudanOption(payoff, bermudanExercise);
>         VanillaOption americanOption(payoff, americanExercise);
>
>         // Analytic formulas:
>
>         // Black-Scholes for European
>         method = "Black-Scholes";
>         europeanOption.setPricingEngine(boost::shared_ptr<PricingEngine>(
>                                      new AnalyticEuropeanEngine(bsmProcess)));
>         std::cout << std::setw(widths[0]) << std::left << method
>                   << std::fixed
>                   << std::setw(widths[1]) << std::left << europeanOption.NPV()
>                   << std::setw(widths[2]) << std::left << "N/A"
>                   << std::setw(widths[3]) << std::left << "N/A"
>                   << std::endl;
> std::cout << europeanObtion.delta();
>
>
> ...
>
> This did not work, what I am missing?

Hi Ibrahim,
        "did not work" as in "compilation error" or "runtime error"? In any
case, what does the error message say exactly?

Luigi


--

The Feynman Problem Solving Algorithm:
1) Write down the problem.
2) Think very hard.
3) Write down the solution.



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev