QuantLib users.

I'm trying to use ql.IborIndex(...) using this example but for USD currency. However, I receive a type error of the following. How can I use this instead of ql.USDLibor(...)? Thank you.

TypeError                                 Traceback (most recent call last)
c:\Users\sc92841\repos\market-risk-model-validation\jira_models\abr409.py in 
----> 1 ql.IborIndex('USDLibor', ql.Period('1M'), 2, ql.USDCurrency, ql.UnitedKingdom(), ql.ModifiedFollowing,  True, ql.Actual360())

~\AppData\Local\Continuum\anaconda3\lib\site-packages\QuantLib\QuantLib.py in __init__(self, *args)
   5432     def __init__(self, *args):
-> 5433         _QuantLib.IborIndex_swiginit(self, _QuantLib.new_IborIndex(*args))
   5435     def businessDayConvention(self):

TypeError: Wrong number or type of arguments for overloaded function 'new_IborIndex'.
  Possible C/C++ prototypes are:
    IborIndex::IborIndex(std::string const &,Period const &,Integer,Currency const &,Calendar const &,BusinessDayConvention,bool,DayCounter const &,Handle< YieldTermStructure > const &)
    IborIndex::IborIndex(std::string const &,Period const &,Integer,Currency const &,Calendar const &,BusinessDayConvention,bool,DayCounter const &)

To create an instance of the currency class you have to call it:

Try ql.USDCurrency() instead of ql.USDCurrency

You can check this site for references on object construction for the QuantLib Python module.


  • $\begingroup$ Ah, it's a call. Thanks. $\endgroup$
    – AnonymousJ
    Mar 10 '20 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.