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
kdj columns and rsv_9 all NaN #2
Comments
Hi, I cannot reproduce it in my environment. Could you please try to upgrade to v0.1.1 and see if the problem persists? I am using the almost latest pandas and maybe pandas fixed it. Here is the script I used to do the test. import pandas.io.data as web
import datetime
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2013, 1, 27)
f = web.DataReader("ASML ", 'yahoo', start, end)
from stockstats import StockDataFrame
df = StockDataFrame.retype(f)
df[['kdjk', 'kdjd', 'kdjj']] Please let me know if the problem persists. It would be very helpful if you could also supply the script that reproduce the problem. Thanks. |
Thanks for testing. |
I was able to reproduce the issue. |
thanks - works great! |
* implement money flow index * update README for mfi * minor fix in MFI calculation (- instead of +) and better tests for MFI * adhere to line length * add kama indicator * shorter line * python 2.7 compatibility * flake8 * flake8 #2 * additional test * add one more test case
Hi,
there are cases where the kdj columns are all NaN. This seems to be related to rsv_9 beeing NaN.
Here is sample data (the first 20 lines of ASML stock quote) which shows the problem:
if rsv_9 is calculated with stockstats, the first value is NaN. This leads to all kdj columns beeing NaN as well. I guess this is due to a division by zero error in _get_rsv in line 251:
How should the code be modified so that this bug doesn't appear?
(or what's the correct value for rsv if high_max - low_min == 0?)
The text was updated successfully, but these errors were encountered: