目录
  1. 1. option-price
  2. 2. Installation
  3. 3. Usage
Documentaion for option-price

option-price

option-price is a Python-based powerful but simple option price calculator. The repo is here.

Installation

1
pip install option-price

Usage

1
from optionprice import Option

You can initialize an option through this:

1
2
3
4
5
6
7
8
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
  • Binary Tree

option-price will pick B-S-M by default. You can simply get the price by using

1
some_option.getPrice()

If you want to calculate in other ways, you can use

1
some_option.getPrice(method='MC',iteration = 500000)

or

1
some_option.getPrice(method='BT',iteration = 1000)

while MC stands for Monte Carlo and BT stands for Binary Tree.

打赏
  • 微信
  • 支付宝

评论