Login  Register

Negative Rates - QuantLib Python - Cap / Floors - QL_NEGATIVE_RATES ??

Posted by Anthony Calleja on Jul 27, 2017; 12:35pm
URL: http://quantlib.414.s1.nabble.com/Negative-Rates-QuantLib-Python-Cap-Floors-QL-NEGATIVE-RATES-tp18453.html

Hi Community,

I am using a QuantLib Python (quantlib-python v1.9) Extension package WHL plugin  (from http://www.lfd.uci.edu/~gohlke/pythonlibs/)  installed into Spyder python-3.5.3.amd64.

I've run into the below runtime error when valuing a capped floating rate bond and this error is also reproducible with the attached python code.

It looks like this problem can be resolved if I enable the QL_NEGATIVE_RATES setting but I can't find a way to do this in Python.  Is this feature available here or is it only available in C?

Traceback (most recent call last):
  File "C:\Users\cala\workspace\ScrapBook\src\negative.py", line 44, in <module>
    print(cap.NPV())
  File "C:\dev\WinPython-64bit-3.5.3.1Qt5\python-3.5.3.amd64\lib\site-packages\QuantLib\QuantLib.py", line 8918, in NPV
    return _QuantLib.Instrument_NPV(self)
RuntimeError: forward + displacement (-0.00738464 + 0) must be positive

Thanks

Anthony


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

negative.py (2K) Download Attachment