Skip to main content

A package to calculate the price of options and the greeks

Project description

Option pricing methods

This package aims to provide 4 different methods to estimate the price of options.

The estimator don't allow to set all the parameters but just accept a stock, in the constructor, and then evaluate the price of an option of that stock. This lead to be able to estimate real world data, but doesn't allow to create custom environment with fake option price, volatility etc. etc.

Instead the estimators takes the last prices (for the period of this prices go to the "setting parameter" section) of the stock and calculate volatility and the drift of the stock.

The 4 model to estimate a the price of an option are the most popular one:

  • binomial model
  • monte carlo simulation
  • black-scholes formula
  • bootstrap

Setting paramter

The only (financial) paramter that should be set is the annual risk free rate. As a default it is set to 0.04 in the super class of the estimator, so it's not a compulsary argument in the estimate methods.

Another parameter that can be set is the period that the estimators take into consideration to calculate the volatility and drift of the stock. Also this parameter is set in the superclass of the estimators and its default value is six months. If we want to change it we should set the estimate method parameter periodForPrices to a value of the period enumeration that is defined in the utilities directory.

Monte carlo estimator

For the monte carlo estimator there are another couple of customizable parameter in the estimate method:

  • numberOfSimulations: the number of simulations of the asset price path that are run to evaluate the option price
  • showSimulationPaths: plot a chart with the paths of the stock price for each simulation

American option

For american options has been implemented a method in the binomial estimator (estimateAmericanOption). In all the other methods we suppose to work with european options

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optionspricingandgreeks-0.0.6.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optionspricingandgreeks-0.0.6-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file optionspricingandgreeks-0.0.6.tar.gz.

File metadata

  • Download URL: optionspricingandgreeks-0.0.6.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for optionspricingandgreeks-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d3d1bab7dd0680bb187d9365d7c86e5776a84864822b4f49d299b5f039155cd8
MD5 395b6011e929f11e85e66f58d5a1a14a
BLAKE2b-256 d95c5eb2ad3db9a6cbff9ee07835c5f9420b3b61c8f5d0a3a94678c09c84f872

See more details on using hashes here.

File details

Details for the file optionspricingandgreeks-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for optionspricingandgreeks-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 cbdd3444c9f01699b2f19cb87a35e2a1021e4e01c40c060affd056b8922cc2f5
MD5 083ccac6e894efd8bce541e44753cc21
BLAKE2b-256 1f031cf2e8a75e03dfd8425c17b594b428ce05abb97c86e99a2546b22b20ad0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page