Skip to main content

Python library for calculating option prices, implied volatility and greeks.

Project description

vollib

vollib is a python library for calculating option prices, implied volatility and greeks. At its core is Peter Jaeckel's source code for LetsBeRational, an extremely fast and accurate algorithm for obtaining Black's implied volatility from option prices.

Building on this solid foundation, vollib provides functions to calculate option prices, implied volatility and greeks using Black, Black-Scholes, and Black-Scholes-Merton. vollib implements both analytical and numerical greeks for each of the three pricing formulae.

Installation

pip install vollib

Dependencies

  • cody-special - High-precision error functions and normal distribution
  • piecewise-rational - Shape-preserving piecewise rational cubic interpolation
  • lets_be_rational - Pure Python implementation of Peter Jaeckel's LetsBeRational
  • numpy
  • pandas
  • scipy
  • simplejson

About the reference Python implementation

vollib contains vollib.ref_python, a pure python version of the functions in vollib.*. It is provided purely as a reference implementation for sanity checking.

About "Let's be Rational"

"Let's Be Rational" is a paper by Peter Jaeckel showing "how Black's volatility can be implied from option prices with as little as two iterations to maximum attainable precision on standard (64 bit floating point) hardware for all possible inputs."

The paper is accompanied by the full C source code, which resides at www.jaeckel.org/LetsBeRational.7z.

Copyright (c) 2013-2014 Peter Jaeckel.

Permission to use, copy, modify, and distribute this software is freely granted,
provided that this notice is preserved.

WARRANTY DISCLAIMER
The Software is provided "as is" without warranty of any kind, either express or implied,
including without limitation any implied warranties of condition, uninterrupted use,
merchantability, fitness for a particular purpose, or non-infringement.

Links

License

MIT

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

vollib-1.0.8.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

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

vollib-1.0.8-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

Details for the file vollib-1.0.8.tar.gz.

File metadata

  • Download URL: vollib-1.0.8.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for vollib-1.0.8.tar.gz
Algorithm Hash digest
SHA256 11aa18881b4b4f60da5daddfb3b069ee27e267f63f5c613ead26c33d0891f0e0
MD5 0852a88d07fa2f768d86c584a3635bcc
BLAKE2b-256 983541761ac99bfd1cab618aa19829b863e2f7925a337f95c7d7f1fe450e2314

See more details on using hashes here.

File details

Details for the file vollib-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: vollib-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 55.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for vollib-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4c476f3577138c8e928eddc54b647453ec3adba05004ef477de5d09e7f5ee717
MD5 a535ab905387eb8e8782e1b0de26bbd3
BLAKE2b-256 6f722f2cb08273aa4f55be7e59ad8808fe7deb517201afdd36a1410b5e126bb8

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