12
$\begingroup$

In my project, I have to get the delta of up and out call option (with vol surface). I found out that QuantLib might help me on that. Since my main language is python and I don't know well about C++, I installed QuantLib-python, in the hope that python is enough to understand QuantLib. But I couldn't find a well-written documentation about QuantLib-Python. I managed to understand some sources in blog posts, like calculating vanilla call option price. I now think that to do what I want to do, I have to understand the C++ sources in QuantLib. Am I right? Or Would there a better and faster way?

$\endgroup$

5 Answers 5

12
$\begingroup$

At this time, there's no specific documentation for QuantLib-Python, except for a series of screencasts that I started a while ago (you can find them on YouTube at https://www.youtube.com/playlist?list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr) but which is far from exhaustive; there's just a few of them for now, and there's no definite learning path.

However, the structure of the library in Python is the same as in C++, except for some changes (like the use of std::shared_ptr in C++ being hidden in Python) that were made so that one could write more idiomatic Python code. Therefore, you should be able to use the resources listed on the QuantLib site at http://quantlib.org/docs.shtml and translate their advice to the corresponding Python code.

One thing you might run into is that not all of QuantLib is exported to Python. Again, there's no documentation of what's there; so when in doubt, search for a feature inside the SWIG interface files to check if it's exported.

Update: last year, Goutham and I have pooled our material and published the QuantLib Python Cookbook. It's still a work in progress, but it might already be useful.

$\endgroup$
8
$\begingroup$

You will find a tutorial of QuantLib using python with simple examples here:

http://gouthamanbalaraman.com/blog/quantlib-python-tutorials-with-examples.html

I have been writing these as a means to be instructive to others going through the process of learning and working with QuantLib. If you have suggestions on what topics you would like to read, please post a comment.

$\endgroup$
0
4
$\begingroup$

I also recommend to see:
https://ipythonquant.wordpress.com/
There are some good examples.

$\endgroup$
2
$\begingroup$

For Chinese user, you can find a tutorial of QuantLib using python and C++:

https://www.cnblogs.com/xuruilong100/p/8711520.html

$\endgroup$
2
$\begingroup$

You can check out a reference to the QuantLib-Python module at:

https://quantlib-python-docs.readthedocs.io

It's still a work in progress but will be very helpful for anyone getting started

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.