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 |
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 On Sat, Sep 10, 2016 at 8:24 PM Björn <[hidden email]> wrote: Hello, ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Luigi, thanks for pointing me to Peter's PR. I'll try that and let both of you know if I encounter any issues. Many thanks Björn On 26 September 2016 at 21:28, Luigi Ballabio [via QuantLib] <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |