ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

talib RSI gives incorrect values

Open DarkoAlexander opened this issue 3 years ago • 8 comments

I have tried every possible way to calculate RSI, but the talib.RSI calculation disagrees with all other packages, libraries and methods to calculate RSI. Is there anybody who knows how talib.RSI calculates RSI values? Please let me know.

DarkoAlexander avatar Aug 12 '21 12:08 DarkoAlexander

You can see how it is calculated:

https://github.com/TA-Lib/ta-lib/blob/master/src/ta_func/ta_RSI.c

On Aug 12, 2021, at 5:27 AM, DarkoAlexander @.***> wrote:

 I have tried every possible way to calculate RSI, but the talib.RSI calculation disagrees with all other packages, libraries and methods to calculate RSI. Is there anybody who knows how talib.RSI calculates RSI values? Please let me know.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

mrjbq7 avatar Aug 12 '21 14:08 mrjbq7

Thank you for the link. The author claims in his comment that the algorithm is based on Wilder's original formula, but this claim is not true. Can we work out a numerical example to display what is going on? All we need is an array of 16 numbers, and showing how the calculation of the first two RSI values is done.

DarkoAlexander avatar Aug 12 '21 16:08 DarkoAlexander

Have you tried calculating with more candles? For me around 50 candles it is pretty close to the tradingview values.

Weyla avatar Aug 14 '21 06:08 Weyla

I was using 15 candles for a 14 period. Now with more candles (300 for example) I find the exact same RSI as TradingView's.

faycalrakza avatar Nov 21 '21 22:11 faycalrakza

Still this problem is there for calculating RSI13 i need to pass more than 300 candles? Because with 50 candles i am not getting correct values

Justin10890 avatar Jan 23 '23 05:01 Justin10890

in issues like this it's always a good idea to leave a code to reproduce the problem are you passing numbers lower than 0.00000001? cause if that's the case you can take a look at this comment

Elyasnz avatar May 24 '23 08:05 Elyasnz

Is this issue resolved ?

diphuaji avatar Dec 02 '23 22:12 diphuaji

What needs to be resolved?On Dec 2, 2023, at 2:16 PM, Tianpeng Xia @.***> wrote: Is this issue resolved ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

mrjbq7 avatar Dec 02 '23 22:12 mrjbq7