有没有人知道Python的任何好的quantlib示例?我似乎无法找到任何地方......
答案 0 :(得分:7)
Ubuntu package quantlib-python
中有一些示例:
/usr/share/doc/quantlib-python/examples/american-option.py
/usr/share/doc/quantlib-python/examples/basket-option.py
/usr/share/doc/quantlib-python/examples/bermudan-swaption.py.gz
/usr/share/doc/quantlib-python/examples/european-option.py
/usr/share/doc/quantlib-python/examples/swap.py.gz
/usr/share/doc/quantlib-python/examples/test/QuantLibTestSuite.py
/usr/share/doc/quantlib-python/examples/test/bonds.py.gz
/usr/share/doc/quantlib-python/examples/test/date.py
/usr/share/doc/quantlib-python/examples/test/instruments.py
/usr/share/doc/quantlib-python/examples/test/integrals.py
/usr/share/doc/quantlib-python/examples/test/marketelements.py
/usr/share/doc/quantlib-python/examples/test/ratehelpers.py
/usr/share/doc/quantlib-python/examples/test/solvers1d.py
/usr/share/doc/quantlib-python/examples/test/termstructures.py.gz
如果您没有使用Ubuntu / Debian,可能会有类似的操作系统包,或者您也可以通过下载quantlib-swig_0.9.9.orig.tar.gz来获取这些文件。
答案 1 :(得分:3)
他们在QuantLib-SWIG发行版中(你可能已经从QuantLib网站获得了这个版本。)一旦解压缩tarball(或zip存档),它们就在Python \ examples文件夹中。
答案 2 :(得分:0)
迄今为止我发现的最好的(仅...)QL / Python示例代码是Tawanda Gwena在https://sites.google.com/site/tgwena/engineering-docs/engineering-permissions-list撰写的代码