Comments (1)
What finally worked for me, as of April 2024, was to install both py_vollib AND py_lets_be_rational from github rather than PyPI.
When they said it was fixed in Github in issue 11, I'm pretty sure they meant it was fixed in py_lets_be_rational. Even if you install py_vollib from github, pip will still grab py_lets_be_rational from PyPI, so you have to install that from Github first.
pip install git+https://github.com/vollib/py_lets_be_rational.git
pip install git+https://github.com/vollib/py_vollib.git
>>> from py_vollib.black import black
>>> flag = 'c' # 'c' for call, 'p' for put
>>> S = 95 # price of the underlying
>>> K = 100 # strike
>>> t = .2 # annualized time to expiration
>>> r = .2 # interest-free rate
>>> sigma = .2 # implied volatility
>>> black(flag, S, K, t, r, sigma)
1.4739294832475103
from py_vollib.
Related Issues (20)
- Black Model's gamma gives a very low number? HOT 1
- ImportError: No module named '_testcapi' HOT 4
- Get Price from Vol HOT 1
- Black-Scholes implied vol BelowIntrinsicError with negative risk-free rate HOT 1
- vectorization in py_vollib HOT 8
- What are 'b' and 'pricing function' arguments for numerical greeks HOT 1
- Boundary condiiton error HOT 1
- Importing py_vollib causes a MySQL import error in a Flask App HOT 1
- Dealing with deep in-the-money index option HOT 1
- Feature Request: Second Order Greeks HOT 2
- Importing library in PyCharm Python Console raises ModuleNotFoundError HOT 1
- Strike from IV and delta HOT 1
- Zero strike price
- Incorrect Theta calculation
- [Question] Is it possible to calculate IV if the option price is given? HOT 1
- NumbaDeprecationWarning
- if spot price is less than 0.01 greeks are returning Nan
- BelowIntrinsicValue exception for Deep in the money put HOT 1
- Very slow to run on SQL Server 2017 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py_vollib.