http://quantlib.414.s1.nabble.com/QuantLib-extension-creating-a-FedFunds-derived-class-equivalent-of-Eonia-for-USD-tp15344p15391.html
On Fri, May 30, 2014 at 10:52 PM, Ioan F. <
> Hello,
>
> I want to duplicate the derived Eonia OvernightIndex class as a derived
> FedFunds OvernightIndex class directly by adding one header and one source
> file (see below) to the <ql/indexes/ibor> QuantLib sub-folder.
> Additionally, I modified the Makefile.in file to include the two files when
> building the QuantLib solution (in Visual Studio 11).
> I can (re)build the solution without any problems, but when I try to use the
> FedFunds class in Python (after adding to the indexes.i SWIG interface file
> in a manner similar to the one which allowed me to successfully expose the
> Sonia class for GBP), I get the error:
>
> NameError: name 'FedFunds' is not defined
>
> Please note that when the same code with Eonia (instead of FedFunds) works
> fine (although I need to join the US and European calendars).
>
> Any help / suggestions appreciated.
> Also, if the files below are any good, feel free to use them.
>
> Thank you,
> Ioan
>
>
>
> fedfunds.hpp:
>
>
>
> /*! \file fedfunds.hpp
> \brief %FedFunds index
> */
>
> #ifndef quantlib_fedfunds_hpp
> #define quantlib_fedfunds_hpp
>
> #include <ql/indexes/iborindex.hpp>
>
> namespace QuantLib {
>
> //! %Fed Funds (for balances held at the Federal Reserve) rate fixed by
> the FED.
> class FedFunds : public OvernightIndex {
> public:
> FedFunds(const Handle<YieldTermStructure>& h =
> Handle<YieldTermStructure>());
> };
>
> }
>
> #endif
>
>
>
>
> fedfunds.cpp:
>
>
>
> #include <ql/indexes/ibor/fedfunds.hpp>
> #include <ql/time/calendars/unitedstates.hpp>
> #include <ql/time/daycounters/actual365fixed.hpp>
> #include <ql/currencies/america.hpp>
>
> namespace QuantLib {
>
> FedFunds::FedFunds(const Handle<YieldTermStructure>& h)
> : OvernightIndex("FedFunds", 0,
> USDCurrency(),
> UnitedStates(UnitedStates::Settlement),
> Actual365Fixed(), h) {}
>
> }
>
>
>
>
> --
> View this message in context:
http://quantlib.10058.n7.nabble.com/QuantLib-extension-creating-a-FedFunds-derived-class-equivalent-of-Eonia-for-USD-tp15344.html> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
>
http://p.sf.net/sfu/restlet> _______________________________________________
> QuantLib-dev mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-devapplications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!