1
$\begingroup$

While pricing Interest Rate Swap, I am providing Fixing rate for historical date using "addFixing(date, value)" function. But when I am trying to change value it is not happening and picking up old value only, giving following error:

"RuntimeError: At least one duplicated fixing provided: January 23rd, 2018, 0.017453 while 0.017452 value is already present"

Is there a way to change this fixing rate?

$\endgroup$

1 Answer 1

1
$\begingroup$

addFixinghas a third parameter forceOverwrite which is false by default. Calling addFixing(date, value, true) will allow the change.

On Python, the third parameter is not exported (you might open an issue on GitHub to fix that). You'll have to go for the nuclear option:

IndexManager.instance().clearHistory(index.name())

will clear the whole history of fixings and allow you to reload it.

$\endgroup$
5
  • $\begingroup$ I tried this but getting error again: index.addFixing(Date(23,1,2018),0.017453, True) TypeError: addFixing() takes 3 positional arguments but 4 were given $\endgroup$
    – BHr
    Commented Apr 24, 2018 at 16:24
  • $\begingroup$ So you're on Python? $\endgroup$ Commented Apr 24, 2018 at 16:29
  • $\begingroup$ Yes, on Python... $\endgroup$
    – BHr
    Commented Apr 24, 2018 at 16:31
  • $\begingroup$ See the update. $\endgroup$ Commented Apr 24, 2018 at 17:15
  • $\begingroup$ Thanks Luigi...created GitHub issue for same github.com/lballabio/QuantLib-SWIG/issues/110. And using nuclear option as of now. $\endgroup$
    – BHr
    Commented Apr 25, 2018 at 9:27

Your Answer

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

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