|
From: Ioan F. <if...@ny...> - 2014-05-21 16:28:05
|
Hello,
I am trying to expose a new type of the SwapRateHelper constructor (already
existent in QuantLib) to Python.
In the ratehelpers.i interface file, I added the following code:
//ADDED
*SwapRateHelperPtr(
const Handle& rate,
const Period &tenor,
const Calendar &calendar,
Frequency fixedFrequency,
BusinessDayConvention fixedConvention,
const DayCounter &fixedDayCount,
const boost::shared_ptr<IborIndex> &index,
const Handle &spread=Handle(),
const Period &fwdStart=0 *Days,
const Handle<YieldTermStructure>
&discountingCurve=Handle<YieldTermStructure>()) {
boost::shared_ptr<IborIndex> libor =
boost::dynamic_pointer_cast<IborIndex>(index);
return new SwapRateHelperPtr(
new SwapRateHelper(rate, tenor, calendar,
fixedFrequency, fixedConvention,
fixedDayCount, libor,
spread, fwdStart,
discountingCurve));*
//END ADDED
I was able to wrap, build and install the QuantLib library (via SWIG) into
Python, but when I try to use the SwapRateHelper in Python, I get the
following error:
*NotImplementedError: Wrong number or type of arguments for overloaded
function 'new_SwapRateHelper'.
Possible C/C++ prototypes are:....*
The following code works:
*qqq=SwapRateHelper(QuoteHandle(eurLiborSwaps[(2, Years)]),
Period(2, Years),
euroCalendar,
fixedLegFrequency,
fixedLegAdjustment,
fixedLegDayCounter,
EURLibor3M(),
QuoteHandle(),
Period(0,0))*
while this one causes the problem:
*qqq=SwapRateHelper(QuoteHandle(eurLiborSwaps[(2, Years)]),
Period(2, Years),
euroCalendar,
fixedLegFrequency,
fixedLegAdjustment,
fixedLegDayCounter,
EURLibor3M(),
QuoteHandle(),
Period(0,0),
eoniaHandle)*
Furthermore, please note that Python reports the type of the eoniaHandle
variable as:
*QuantLib.QuantLib.YieldTermStructureHandle*
Any help or suggestions are highly appreciated.
Since this is my first time posting, please excuse any breaking of the
"mailing list etiquette."
Thank you,
Ioan
--
View this message in context: http://quantlib.10058.n7.nabble.com/SwapRateHelper-Question-SWIG-Python-tp15297.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|