Re: QuantLib extension - creating a FedFunds derived class (equivalent of Eonia for USD)
Posted by Ioan F. on Jun 05, 2014; 3:19pm
URL: http://quantlib.414.s1.nabble.com/QuantLib-extension-creating-a-FedFunds-derived-class-equivalent-of-Eonia-for-USD-tp15344p15395.html
Hi Luigi,
Thank you for the reply. Please see the relevant part of the indexes.i interface file below.
Also note that the first two "export_quoted_xibor_instance" calls work fine, as I was able to use them in Python (Eonia and Sonia), while the third one (FedFunds) gives me the error.
Regards,
Ioan
// OvernightIndex indexes
%{
using QuantLib::OvernightIndex;
typedef boost::shared_ptr<Index> OvernightIndexPtr;
%}
%rename(OvernightIndex) OvernightIndexPtr;
class OvernightIndexPtr : public IborIndexPtr {
public:
%extend {
OvernightIndexPtr(const std::string& familyName,
Natural settlementDays,
const Currency& currency,
const Calendar& calendar,
const DayCounter& dayCounter,
const Handle<YieldTermStructure>& h =
Handle<YieldTermStructure>())
{
return new OvernightIndexPtr(new OvernightIndex(familyName,
settlementDays,
currency,
calendar,
dayCounter, h));
}
}
};
export_quoted_xibor_instance(Eonia,OvernightIndex);
export_quoted_xibor_instance(Sonia,OvernightIndex);
export_quotes_xibor_instance(FedFunds,OvernightIndex);