-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
RSI calculation bug? #637
Comments
Are your prices very close to zero? There is some discussion on this issue #157:https://github.com/TA-Lib/ta-lib-python/issues/157On Jan 21, 2024, at 4:35 AM, jencijanos ***@***.***> wrote:
found a problem in the calculations RSI. df['RSI_14_close'] = RSI(df, timeperiod=14) give me
date,open,high,low,close,RSI_14_close
2024-01-21 00:30:00,1.324e-05,1.331e-05,1.323e-05,1.327e-05,
2024-01-21 00:45:00,1.327e-05,1.33e-05,1.326e-05,1.327e-05,
2024-01-21 01:00:00,1.327e-05,1.33e-05,1.317e-05,1.324e-05,
2024-01-21 01:15:00,1.323e-05,1.325e-05,1.323e-05,1.325e-05,
2024-01-21 01:30:00,1.324e-05,1.325e-05,1.321e-05,1.325e-05,
2024-01-21 01:45:00,1.324e-05,1.327e-05,1.324e-05,1.327e-05,
2024-01-21 02:00:00,1.326e-05,1.327e-05,1.325e-05,1.326e-05,
2024-01-21 02:15:00,1.326e-05,1.327e-05,1.325e-05,1.327e-05,
2024-01-21 02:30:00,1.327e-05,1.328e-05,1.325e-05,1.327e-05,
2024-01-21 02:45:00,1.327e-05,1.327e-05,1.324e-05,1.326e-05,
2024-01-21 03:00:00,1.326e-05,1.327e-05,1.324e-05,1.327e-05,
2024-01-21 03:15:00,1.326e-05,1.329e-05,1.326e-05,1.328e-05,
2024-01-21 03:30:00,1.329e-05,1.329e-05,1.327e-05,1.328e-05,
2024-01-21 03:45:00,1.328e-05,1.33e-05,1.327e-05,1.33e-05,
2024-01-21 04:00:00,1.33e-05,1.33e-05,1.328e-05,1.33e-05,0.0
2024-01-21 04:15:00,1.33e-05,1.331e-05,1.33e-05,1.33e-05,0.0
2024-01-21 04:30:00,1.33e-05,1.33e-05,1.328e-05,1.328e-05,0.0
2024-01-21 04:45:00,1.329e-05,1.329e-05,1.326e-05,1.329e-05,0.0
2024-01-21 05:00:00,1.329e-05,1.329e-05,1.327e-05,1.327e-05,48.02516157768909
2024-01-21 05:15:00,1.328e-05,1.329e-05,1.327e-05,1.328e-05,51.66093531184409
2024-01-21 05:30:00,1.329e-05,1.329e-05,1.327e-05,1.329e-05,55.0473756916628
2024-01-21 05:45:00,1.328e-05,1.33e-05,1.327e-05,1.33e-05,58.20090420105429
2024-01-21 06:00:00,1.329e-05,1.33e-05,1.327e-05,1.328e-05,50.56124249753458
2024-01-21 06:15:00,1.328e-05,1.33e-05,1.327e-05,1.329e-05,53.82491650741884
2024-01-21 06:30:00,1.329e-05,1.329e-05,1.326e-05,1.326e-05,44.36323416932482
2024-01-21 06:45:00,1.326e-05,1.327e-05,1.326e-05,1.327e-05,47.66567506367998
2024-01-21 07:00:00,1.327e-05,1.328e-05,1.326e-05,1.328e-05,50.81004942611891
2024-01-21 07:15:00,1.327e-05,1.328e-05,1.325e-05,1.326e-05,44.98820062387063
2024-01-21 07:30:00,1.326e-05,1.328e-05,1.325e-05,1.328e-05,51.030740499714675
2024-01-21 07:45:00,1.327e-05,1.327e-05,1.325e-05,1.326e-05,45.63282909230429
2024-01-21 08:00:00,1.325e-05,1.326e-05,1.324e-05,1.324e-05,40.966190717700854
2024-01-21 08:15:00,1.325e-05,1.326e-05,1.324e-05,1.325e-05,44.0472689820242
2024-01-21 08:30:00,1.324e-05,1.326e-05,1.324e-05,1.325e-05,44.0472689820242
2024-01-21 08:45:00,1.326e-05,1.327e-05,1.325e-05,1.326e-05,47.24078857317984
2024-01-21 09:00:00,1.326e-05,1.327e-05,1.324e-05,1.325e-05,44.50524180500565
2024-01-21 09:15:00,1.324e-05,1.325e-05,1.324e-05,1.324e-05,41.89277478880581
2024-01-21 09:30:00,1.325e-05,1.325e-05,1.323e-05,1.323e-05,39.40195609170993
2024-01-21 09:45:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,43.048589907178076
2024-01-21 10:00:00,1.323e-05,1.324e-05,1.322e-05,1.324e-05,43.048589907178076
2024-01-21 10:15:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,43.048589907178076
2024-01-21 10:30:00,1.323e-05,1.325e-05,1.323e-05,1.324e-05,0.0
2024-01-21 10:45:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,0.0
2024-01-21 11:00:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,0.0
2024-01-21 11:15:00,1.324e-05,1.326e-05,1.323e-05,1.325e-05,0.0
2024-01-21 11:30:00,1.325e-05,1.326e-05,1.324e-05,1.326e-05,0.0
2024-01-21 11:45:00,1.326e-05,1.327e-05,1.325e-05,1.326e-05,0.0
2024-01-21 12:00:00,1.326e-05,1.327e-05,1.325e-05,1.325e-05,0.0
2024-01-21 12:15:00,1.326e-05,1.326e-05,1.324e-05,1.324e-05,0.0
2024-01-21 12:30:00,1.325e-05,1.325e-05,1.322e-05,1.323e-05,0.0
2024-01-21 12:45:00,1.324e-05,1.325e-05,1.322e-05,1.324e-05,0.0
zero in last 10 line.
same input data calculated using pandas-ta give "other" result
...
2024-01-21 08:00:00,1.325e-05,1.326e-05,1.324e-05,1.324e-05,40.18228008822393
2024-01-21 08:15:00,1.325e-05,1.326e-05,1.324e-05,1.325e-05,43.557040811558295
2024-01-21 08:30:00,1.324e-05,1.326e-05,1.324e-05,1.325e-05,43.557040811558295
2024-01-21 08:45:00,1.326e-05,1.327e-05,1.325e-05,1.326e-05,47.02334768897121
2024-01-21 09:00:00,1.326e-05,1.327e-05,1.324e-05,1.325e-05,44.10630620385045
2024-01-21 09:15:00,1.324e-05,1.325e-05,1.324e-05,1.324e-05,41.34427175267467
2024-01-21 09:30:00,1.325e-05,1.325e-05,1.323e-05,1.323e-05,38.73219915753848
2024-01-21 09:45:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,42.63521193429178
2024-01-21 10:00:00,1.323e-05,1.324e-05,1.322e-05,1.324e-05,42.635211934291775
2024-01-21 10:15:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,42.635211934291775
2024-01-21 10:30:00,1.323e-05,1.325e-05,1.323e-05,1.324e-05,42.635211934291775
2024-01-21 10:45:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,42.635211934291775
2024-01-21 11:00:00,1.324e-05,1.325e-05,1.323e-05,1.324e-05,42.63521193429178
2024-01-21 11:15:00,1.324e-05,1.326e-05,1.323e-05,1.325e-05,47.820530475251424
2024-01-21 11:30:00,1.325e-05,1.326e-05,1.324e-05,1.326e-05,52.44935913524291
2024-01-21 11:45:00,1.326e-05,1.327e-05,1.325e-05,1.326e-05,52.449359135242915
2024-01-21 12:00:00,1.326e-05,1.327e-05,1.325e-05,1.325e-05,47.55662274186611
2024-01-21 12:15:00,1.326e-05,1.326e-05,1.324e-05,1.324e-05,43.215193045925396
2024-01-21 12:30:00,1.325e-05,1.325e-05,1.322e-05,1.323e-05,39.34691942233122
2024-01-21 12:45:00,1.324e-05,1.325e-05,1.322e-05,1.324e-05,44.679657715934646
2024-01-21 13:00:00,1.324e-05,1.325e-05,1.324e-05,1.325e-05,49.464611017551896
macos monterey
Python 3.11.1
ta-lib 0.4.0
python modules:
Cython==3.0.8
numpy==1.26.3
pandas==2.1.4
pycparser==2.21
requests==2.31.0
scipy==1.11.4
TA-Lib==0.4.28
pytest passed witout any error
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
You can multiply your prices by 10000 and then calculate rsiYou can patch your talib the way the issue suggestsOr suggest another approach On Jan 21, 2024, at 8:15 AM, jencijanos ***@***.***> wrote:
@mrjbq7 thanks for the quick response, and your link to issue #157. This "feature" make unusable implementation of TAlib in python for me... or is there some universal solution?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
found a problem in the calculations RSI.
df['RSI_14_close'] = RSI(df, timeperiod=14)
give mezero in last 10 line.
same input data calculated using pandas-ta give "other" result
macos monterey
Python 3.11.1
ta-lib 0.4.0
python modules:
Cython==3.0.8
numpy==1.26.3
pandas==2.1.4
pycparser==2.21
requests==2.31.0
scipy==1.11.4
TA-Lib==0.4.28
pytest
passed witout any errorThe text was updated successfully, but these errors were encountered: