1
$\begingroup$

Is there a good python package for various option pricing models, e.g., Heston, SABR, etc? I found that it's even hard to find a good python implementation of Black-Scholes model (i.e., price + IV + all Greeks implemented in a class).

I know there's QuantLib python, but it is implemented in C/C++. Not to mention I have to install C/C++ compiler, it's quite difficult to quickly test/change for new ideas for research purpose.

$\endgroup$
3
  • $\begingroup$ I know your question was from a long time ago, but what alternative did you end up chosing? $\endgroup$
    – H.L.
    Nov 10, 2021 at 19:08
  • 2
    $\begingroup$ @H.L. I ended up creating one myself. The package is called pyfeng. See pypi.org/project/pyfeng $\endgroup$
    – jChoi
    Nov 24, 2021 at 4:33
  • $\begingroup$ You should look at github.com/domokane/FinancePy $\endgroup$ Feb 17 at 16:03

1 Answer 1

4
$\begingroup$

If you follow the below instructions, you won't need a C++ compiler. Also, you don't care what language the library is implemented in, all you have to do is call the functions.

Installation from PyPI

If you don't need to modify the wrappers, you might want to try installing a precompiled binary version. The availability of binaries depend on your operating system; to try to install them, run:

pip install QuantLib-Python

If a binary package is available for your system, it will be installed and you will be able to leave this page and use it right away; if not, you'll have to compile it yourself as described in the next section.

source: https://www.quantlib.org/install/windows-python.shtml

$\endgroup$
3
  • $\begingroup$ Thanks. Changing code won't be easy with QunatLib-Python, but it'll be still helpful, e.g., for checking against my implementation. $\endgroup$
    – jChoi
    Oct 24, 2018 at 14:20
  • 1
    $\begingroup$ @JaehyukChoi what are you actually trying to do? Changing the code of the library defeats the purpose of using a third-party library. $\endgroup$
    – 0xFEE1DEAD
    Oct 24, 2018 at 14:23
  • $\begingroup$ I want to modify codes for research purposes, e.g. testing new methods, etc. It's always easier to do from existing code than from scratch. $\endgroup$
    – jChoi
    Oct 27, 2018 at 15:48

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.