Login  Register

Re: Exposure Issues

Posted by Eric Ehlers-2 on Aug 15, 2008; 10:31am
URL: http://quantlib.414.s1.nabble.com/Exposure-Issues-tp12286p12291.html

Hi Rahul,

On Thu, August 14, 2008 12:38, Rahul Gupta wrote:
> Eric,
>
> Thank you for such a thorough reply.

Happy to help.

> I should first clarify the following issues:
>
> 1) I was explicitly providing a null, I merely didn't type it correctly. 2)
The boosts issue is again a testament to my typing skills.

That makes more sense.

> Now with regards to the engine.  I believe that I may have taken an
excessively complex route towards adding an engine.  My terminal goal is to
expose Analytic and MC heston engines.  Assuming I strip my code, would this
be the best way to add the engines?
>
> 1) Provide a type in enumeratedclasses.xml - Analytic = without
> timesteps, MC = with timesteps [in terms of type] (say, AHE and MCHE) 2) Add
a similar definition in pricingengines.xml/cpp/hpp to what I have already
done in my own files.

I have just reviewed the code in more detail, it's slightly more complicated.
Pricing engines come in 2 flavors:

1) Full fledged objects
2) Enumerated classes
   2a) Without timesteps
   2b) With timesteps

DiscountingSwapEngine is an example of 1):
- Class QuantLibAddin::DiscountingSwapEngine is implemented in files
    QuantLibAddin\qlo\pricingengines.*pp
- Function qlDiscountingSwapEngine() is configured in file
    QuantLibAddin\gensrc\metadata\functions\pricingengines.xml

AnalyticEuropeanEngine is an example of 2a):
- Function AE_Engine() is implemented in files
    QuantLibAddin\qlo\enumerations\constructors\enumeratedclasses.*pp
- Enumeration AE is configured in file
    QuantLibAddin\gensrc\metadata\enumerations\enumeratedclasses.xml

Note that in the case of 2) no QuantLibAddin class is implemented.

Your new classes would need to follow one approach or the other.  The
differences between the two approaches should be fairly clear:

    1) Fully fledged stateful object which can be instantiated in its own
        cell, serialized, etc.  No restrictions on the signature of the
        constructor.

    2) Enumeration, exists only as a transient object which cannot be directly
        accessed by the user, must conform to one of the two available
        constructor signatures (2a or 2b).

Before starting on this I would first identify the cause of the "class xxx is
not available" error.  As mentioned I can't see anything in your description
of your initial changes which would have caused that error and you should get
to the bottom of that before proceeding.

Please let me know how it goes.  Maybe when this is done there will be some
code to contribute back to the project, and perhaps a new section on
enumerations in the "Extending QuantLibXL" tutorial?

Regards,
Eric

-------------------------
Eric Ehlers
nazcatech sprl | Brussels | http://www.nazcatech.be
Distributed computing for pricing analytics - Use Microsoft Excel as a client
to the Grid


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev