Python: SwapRateHelper

Posted by Chuck Swiger-4 on
URL: http://quantlib.414.s1.nabble.com/Python-SwapRateHelper-tp7908.html

Hi All - Enjoying the project very much. I'm trying to implement
bonds.cpp in Python and stuck at:

        boost::shared_ptr<RateHelper> s2y(new SwapRateHelper(
                Handle<Quote>(s2yRate),
                2*Years,
                calendar,
                swFixedLegFrequency,
                swFixedLegConvention,
                swFixedLegDayCounter,
                swFloatingLegIndex,
                Handle<Quote>(),
                forwardStart));

getting an error about wrong number of args, using:

>>> s2y =
SwapRateHelper(QuoteHandle(s2yRate),Period(2,Years),calendar,swFixedLegFrequency,swFixedLegConvention, swFixedLegDayCounter,swFloatingLegIndex,QuoteHandle(),forwardStart)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/QuantLib/QuantLib.py", line
7160, in __init__
    this = _QuantLib.new_SwapRateHelper(*args)
NotImplementedError: Wrong number of arguments for overloaded function
'new_SwapRateHelper'.
  Possible C/C++ prototypes are:
    SwapRateHelperPtr(Handle< Quote > const &,Period const &,Calendar
const &,Frequency,BusinessDayConvention,DayCounter const &,IborIndexPtr
const &)
    SwapRateHelperPtr(Rate,Period const &,Calendar const
&,Frequency,BusinessDayConvention,DayCounter const &,IborIndexPtr const
&)



The SWIG wrapper has two candidates, the closest being:

        *new_SwapRateHelperPtr__SWIG_0(
                Handle< Quote > const &rate,
                Period const &tenor,
                Calendar const &calendar,
                Frequency fixedFrequency,
                BusinessDayConvention fixedConvention,
                DayCounter const &fixedDayCount,
                IborIndexPtr const &index){
        boost::shared_ptr<IborIndex> libor =
                boost::dynamic_pointer_cast<IborIndex>(index);
        ...
        new SwapRateHelper(rate, tenor, calendar,
                fixedFrequency, fixedConvention,
                fixedDayCount, libor));


and the ql srcratehelpers.cpp has the correct  matching argument list:

        SwapRateHelper::SwapRateHelper(const Handle<Quote>& rate,
                                   const Period& tenor,
                                   const Calendar& calendar,
                                   Frequency fixedFrequency,
                                   BusinessDayConvention fixedConvention,
                                   const DayCounter& fixedDayCount,
                                   const shared_ptr<IborIndex>& iborIndex,
                                   const Handle<Quote>& spread,
                                   const Period& fwdStart)

Does this mean the Python wrapper is incomplete for implementing bonds.cpp, or am I missing something??

Thanks!

--Chuck




------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users