-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple ZeroDivisionError error on Windows #1
Comments
ref_python, as the name implies, is just there for reference. It does not benefit from any of the speedups of Peter Jaeckel's algorithms. That said, if you don't need the speed, ref_python should work for you. I don't understand why there should be any Windows dependencies. We made py_vollib to remove all SWIG and C compiler dependencies, and we thoroughly tested it on Python 3.x. When I run the example above on Python 3.6.4 on Mac OSX, I get: >>> import py_vollib.black.implied_volatility as biv
>>> P = 30.70
>>> F = 1685
>>> K = 1680
>>> r= .06
>>> flag = "c"
>>> biv.implied_volatility(P, F, K, r, 0.35, flag)
0.07248728185534212 It has been a long time since you opened this issue. (Apologies for not noticing until now) I would be interested to know whether you still have the problem and with which versions of Python & Windows. Larry |
By the way, you're using Black IV in your example. Black IV expect you to use the forward price (or futures price, in the case of futures options). Are you confident that your F is the forward price, and not the spot? |
If you want to use the spot price, you should use |
BTW, thank you for highlighting this misuse of |
I just ran into the same problem while launching it in an Amazon compute engine with Linux. Has this issue been solved? Just installed py_vollib using pip for python3, so I would expect it to be the latest. |
As highlighted in vollib/py_vollib#1 and vollib/py_vollib#11. Copy of vollib#2.
As highlighted in vollib/py_vollib#1 and vollib/py_vollib#11. Copy of vollib#2.
_testcapi now removed from github repository version.ee |
I am using Winpython64bit Python3.5 distribution on my Windows10 64 bit pc. When I first ran function to find black implied volatility I got an error saying that
ImportError: No module named _testcapi
Apparently _testcapi is not a package which can be installed using pip. It comes pre-installed. Neverthless, I went to py_lets_be_rational\constants and removed the
from _testcapi import DBL_MIN, DBL_MAX
line and added the following:
The values captured by DBL_MIN and DBL_MAX are as follows:
After this the code was compiling and I could run the example mentioned in the documentation. It worked okay. Next, I tried to find the iv of an actual trading option on link:
https://nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=ACC&instrument=FUTSTK&type=-&strike=-&expiry=25MAY2017
I used the following and got the error:
I keep getting this error for almost all options. Then on my windows machine again, I tried calculating the implied vol using the py_vollib.ref_python modules and it worked. Next, I used another pc with linux and Anaconda python distribution and ran the original py_vollib.black.implied_volatility module and it worked well.
So, we have a situation where I am able to calculate options prices on linux distribution and on Windows 64bit platform using ref_python module but not through the recommended way on Windows 64 bit platform. Any suggestions? I want to use this package on a windows machine, would you recommend me using the ref_python modules in the interim? What could be the challenge?
The text was updated successfully, but these errors were encountered: