Python QuantLib 示例?

13 投票
3 回答
6883 浏览
提问于 2025-04-15 23:22

有没有人知道一些好的Python用的quantlib示例?我好像到处都找不到...

3 个回答

0

到目前为止,我找到的最好的(唯一的)QL/Python示例代码是Tawanda Gwena写的,地址在这里:https://sites.google.com/site/tgwena/engineering-docs/engineering-permissions-list

6

这些文件在QuantLib-SWIG的分发包里(你可能已经从QuantLib网站下载过了)。解压缩这个压缩包(tar包或zip包)后,它们会在Python\examples文件夹里。

7

Ubuntu软件包中,有一些关于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来获取这些文件。

撰写回答