Posted by
eric ehlers on
Feb 08, 2006; 11:34am
URL: http://quantlib.414.s1.nabble.com/Customizing-QLAddin-mini-how-to-question-tp4453p4456.html
Hello
> If this can save some time to others the procedure to add new functionality
> is fairly simple and it involves the following steps:
There's already a how-to of sorts on extending QuantLibAddin:
http://quantlib.org/quantlibaddin/extending.htmlHowever it's slightly out of date and will become slightly more so
with the upcoming release of QuantLibAddin 0.3.12 which includes
further enhancements to srcgen.
Any corrections/clarifications to the doc would be gratefully received! ;-)
> Further info here
http://quantlib.org/quep/quep012.htmThat doc is superceded by the QuantLibAddin design doc:
http://quantlib.org/quantlibaddin/design.htmlI'll update the QuEP with a pointer to the design doc (which
incidentally _is_ completely up to date in CVS).
> There are some glitches:
>
> * Most annoying is that if the xll is not properly loaded, the "Insert Function"
> wizard will cause excel to crash.
Annoying indeed - this needs to be fixed. However I'm unable to
recreate the error, please could you email me directly with steps to
recreate the crash and I'll provide a fix.
> * Some of the exposed objects do not have a getObject() method, so, in order to
> use their methods you also need to modify the appropriate QuantLibAddin/XYZ.hpp
> file and add a line like this to the relevant object:
>
> const QuantLib::RateHelper& getObject() const {return *rateHelper_;}
>
> I think that a good policy would be to add getObject to all objects.
I agree, I'll put this in when I get the chance.
> * I do not know how to "concatenate" objects in a single function call (assuming
> it is possible to do so). E.G. I was trying to get the lastDate of a RateHelper
> in excel format (=long). The call to RateHelper->lastDate() returns a Date()
> object, on which I then need to execute the serialNumber method. I am not sure
> how to specify that in the XML file used by srcgen.
This isn't supported. srcgen does support the conversion of a long to
a Date - see parameter settlementDate in function qlBondAccrued.
Given the current implementation of srcgen you'll need to add a
wrapper function to qla/termstructures.*pp. Alternatively srcgen
could easily be extended to support the conversion of a Date to a
long. Support for more generic "concatenation" would be harder.
Regards,
Eric