Awesome but light option price calculator in Python
Project description
option-price
option-price
is a Python-based powerful but simple option price calculator. A GUI version is available here. It makes use of vectorization, which makes it pretty fast.
Installation
pip install option-price
Usage
from optionprice import Option
An option can be initialized by:
some_option = Option(european=False,
kind=1,
s0=100,
k=120,
t=45,
sigma=0.01,
r=0.05,
dv=0)
option-price
has three approaches to calculate the price of the price of the option. They are
- B-S-M
- Monte Carlo
- Binomial Tree
option-price
will choose B-S-M algorithm by default. Prices can be simply calculated by
some_option.getPrice()
Other methods of calculation are available by adding some parameters. For instance,
some_option.getPrice(method='MC',iteration = 500000)
or
some_option.getPrice(method='BT',iteration = 10000)
while MC stands for Monte Carlo and BT stands for Binomial Tree.
The iteration has a default value 5000. Note that the larger the value, the slower and more precise the price.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for option_price-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0d9a5f1fe6b2414273006cd16a1a7ab4afd91d5ca9edba201f4cb80b546ea6b |
|
MD5 | 0243ba6c19d217226ecf7658025e5503 |
|
BLAKE2b-256 | 01b7eadb4884ffa57fd6f2fc672d7e4b976e99efd9f8650093171a7597cef2b2 |