Hi,
Is it possible to generate a QuantLib Schedule in python just with specific defined dates? I'm intending to just download a bond coupon schedule from bloomberg, thus avoiding any problems with stubs. Thanks, Tobias |
Here is an example https://leanpub.com/quantlibpythoncookbook/read
------------------------------------------------------------------------------ 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 |
This will build the schedule, but passing it to other classes such as FixedRateBond won't work. The Schedule constructor exported to Python should be extended to support the additional parameters now available in C++. Until then, schedules built in this way won't be very useful... Luigi On Thu, May 11, 2017 at 4:17 AM CK TUNG <[hidden email]> wrote:
------------------------------------------------------------------------------ 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 |
what I think is QuantLib Python interface file needs to be updated and wrap again. For this case just add this to scheduler.i and rebuild
------------------------------------------------------------------------------ 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 |
Hmm. Unfortunately, I don't think that SWIG supports boost::optional out of the box. It will require some kind of mapping, which might be the reason the wrappers are not updated yet. On Fri, May 12, 2017, 12:15 CK TUNG <[hidden email]> wrote:
------------------------------------------------------------------------------ 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 |
In fact I have tried it in Windows SWIG, it works.
------------------------------------------------------------------------------ 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 |
That's great to know. May you open a pull request? Luigi On Fri, May 12, 2017 at 12:37 PM CK TUNG <[hidden email]> wrote:
------------------------------------------------------------------------------ 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 |
However, I don't know how to change it into named parameters in SWIG. The last parameter isRegular is always needed for the FixedRateBond. Others are really optional.
------------------------------------------------------------------------------ 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 |
Unfortunately, SWIG can't generate wrappers with named parameters if the constructor is overloaded. On Fri, May 12, 2017 at 1:40 PM CK TUNG <[hidden email]> wrote:
------------------------------------------------------------------------------ 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 |
Free forum by Nabble | Edit this page |