couple of quick questions

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

couple of quick questions

aedallan
Hi, I am trying to put together a quick benchmarking code using quantlib for euro puts with the FDEuropeanEngine. It's mostly done using the EquityOption.cpp example but I haven't used ql before today and have limited knowledge of c++ so it's a bit uphill. Any help much appreciated.

Can someone tell me how to set the price range (is is linear of log scale?) and secondly how to fiddle with the solver? Crank Nicolson seems to be default.

Many thanks.

PS. Is extracting all values from the solver easily done? Seems like a waste of information that only NPV is available...


Reply | Threaded
Open this post in threaded view
|

Re: couple of quick questions

Luigi Ballabio
Greetings,

On Wed, 2008-01-02 at 13:40 -0800, aedallan wrote:
> Hi, I am trying to put together a quick benchmarking code using quantlib for
> euro puts with the FDEuropeanEngine. It's mostly done using the
> EquityOption.cpp example but I haven't used ql before today and have limited
> knowledge of c++ so it's a bit uphill. Any help much appreciated.
>
> Can someone tell me how to set the price range (is is linear of log scale?)
> and secondly how to fiddle with the solver? Crank Nicolson seems to be
> default.

At this time, this is not possible. The FDEuropeanEngine class should be
modified so that it takes a suggested range (in the current
implementation, the price range is logarithmic and goes 4 sigma either
side of the current underlying price, sigma being the volatility for the
square root of the residual time) and a suggested solver. The range
should be passed to the constructor; the solver should be passed as a
template argument to the class. Do you think you can have a try?

> PS. Is extracting all values from the solver easily done? Seems like a waste
> of information that only NPV is available...

The values at t=0 are available, even though it might not be obvious.
You can retrieve them from the option with:

SampledCurve values = option.result<SampledCurve>("priceCurve");

Later,
        Luigi

--

Every solution breeds new problems.
-- unknown



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users