Exposure Issues
Posted by Rahul Gupta on
URL: http://quantlib.414.s1.nabble.com/Exposure-Issues-tp12286.html
My aim has been to expose the Heston process, model, and analytic engine to QuantLibXL.
For the process/model, I simply followed the guide, and it worked fine. However for the analytic engine, the approach I took was to inherit from the pricingengine class. I did this as follows:
analytichestonengine.hpp:
namespace QuantLibAddin {
//class AnalyticHestonEngine : public ObjectHandler::LibraryObject<QuantLib::PricingEngine> {
class AnalyticHestonEngine : public QuantLibAddin::PricingEngine {
public:
AnalyticHestonEngine(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
const boost::shared_ptr<QuantLib::HestonModel> &model,
double integrationOrder, bool permanent);
};
}
analytichestonengine.cpp:
namespace QuantLibAddin {
AnalyticHestonEngine::AnalyticHestonEngine(
const boost::shared_ptr<ObjectHandler::ValueObject> &properties,
const boost::shared_ptr<QuantLib::HestonModel> &model,
double integrationOrder, bool permanent)
: QuantLibAddin::PricingEngine(properties, permanent) {
libraryObject_ = boost::shared_ptr<QuantLib::PricingEngine>(
new QuantLib::AnalyticHestonEngine(model, (int)integrationOrder));
}
}
Unfortunately, whilst this works fine, I appear to have broken the core functionality.
When I try to instantiate a qlPricingEngine("AE",B30), i.e. a GeneralizedBlackScholesEngine, I get #NUM, and the following error from ohRetrieveError():
qlPricingEngine - Error retrieving Enumeration from Registry - the type 'class boost::shared_ptr<class QuantLib::PricingEngine> (__cdecl*)(class boosts::shared_ptr<class QuantLib::GeneralizedBlackScholesProcess> const &)' is not available!
I would really appreciate any input, as i'm kinda stuck.
Thanks!