Suppose we have had constructed an index for forecasting future interests of a floating bond, and as suggested by the official document, I used addFixing method to set a past fixing for the current coupon. What I confused was when I reset the addFixing value the program returned an error which says "At least one duplicated fixing provided: ..." . To solve this problem, I backed to check the source code and api doc, and found that there is a parameter called forceOverwrite which seems to be what I need, but when I changed the default value to True, the program told me that "addFixing() got an unexpected keyword argument 'forceOverwrite'". So, is it a bug in QuantLib-Python? If not, what should I do to change the value after having calling addFixing once. Thanks!

flat_forward = FlatForward(Date(8, 5, 2017), 0.04, Actual360(), Compounded, Quarterly)
term_structure = RelinkableYieldTermStructureHandle(flat_forward)
index = USDLibor(Period(3, Months), term_structure)
index.addFixing(Date(24, 3, 2017), 0.03)  # how to change 0.03 to 0.05

enter image description here


1 Answer 1


The parameter is not exposed to Python in the current release. It will in the next (see https://github.com/lballabio/QuantLib-SWIG/pull/125, which was merged in the master branch one month ago). If you don't want to wait, you can check out the latest version of the code from GitHub.

A note: the parameter will be exposed, but due to the machinery used by SWIG to generate wrappers you probably won't be able to pass it as a keyword argument. Instead of forceOverwrite=True, just pass True.

  • $\begingroup$ Thanks very much, @Luigi Ballabio. Looking forward to the release of the next version . $\endgroup$
    – Fitz_Hoo
    Sep 4, 2018 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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