Kernel: Python 3 (system-wide)
QuantLib on CoCalc
Example taken from http://gouthamanbalaraman.com/blog/european-option-binomial-tree-quantlib-python.html
In [2]:
In [3]:
Out[3]:
'1.24'
Demonstrates how to price European options using QuantLib Python. Methods using Black-Scholes-Merton formula and binomial tree will be discussed.
In [4]:
In [5]:
The Black-Scholes-Merto process is constructed here
In [7]:
In [9]:
Out[9]:
The theoretical price is 6.749271812460607
In [10]:
In [11]:
Out[11]:
<matplotlib.legend.Legend at 0x7f25d6afbdc0>
In [0]: