Re: Swaption pricing with negative rates in python
Posted by
Luigi Ballabio on
Sep 26, 2016; 7:28pm
URL: http://quantlib.414.s1.nabble.com/Swaption-pricing-with-negative-rates-in-python-tp17714p17759.html
Hello Bjorn,
sorry for the late answer. I didn't have much time to give to the mailing list this month.
The normal and displaced lognormal model are not available in the current release of the Python bindings, but Peter Caspers just opened a pull request that adds them. You can find it at <
https://github.com/lballabio/QuantLib-SWIG/pull/32>; if you want to try it, you can check out the changes from Peter's fork and rebuild the module. Drop me a line if you need instructions.
Luigi
Hello,
I was really excited when I learned that support for negative rates had been
added to the QL option models. However, I can't get the shifted normal model
or the Bachelier model to work via the QL-Python SWIG bindings. Is there a
tutorial available showing how to use them?
What I'm trying to do is something along the lines:
vol1 = QuoteHandle(SimpleQuote(0.1533))
swaption1.setPricingEngine(BlackSwaptionEngine(termStructure, vol1, -0.03))
swaption2.setPricingEngine(BachelierSwaptionEngine(termStructure, vol1))
But already the first setPricingEngine() fails:
File "<stdin>", line 1, in <module>
File "EuropeanSwaption.py", line 207, in <module>
swaption1.setPricingEngine(BlackSwaptionEngine(termStructure,vol1,-0.03))
File "/Library/Python/2.7/site-packages/QuantLib/QuantLib.py", line 17495,
in __init__
this = _QuantLib.new_BlackSwaptionEngine(*args)
NotImplementedError: Wrong number or type of arguments for overloaded
function 'new_BlackSwaptionEngine'.
Possible C/C++ prototypes are:
BlackSwaptionEnginePtr::BlackSwaptionEnginePtr(Handle<
YieldTermStructure > const &,Handle< Quote > const &)
BlackSwaptionEnginePtr::BlackSwaptionEnginePtr(Handle<
YieldTermStructure > const &,Handle< SwaptionVolatilityStructure > const &)
What am I doing wrong here?
Thanks,
Björn
--
View this message in context: http://quantlib.10058.n7.nabble.com/Swaption-pricing-with-negative-rates-in-python-tp17714.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users