Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Using the talib.RSI() is "danger"?

I happen to notice that the return values by talib.RSI() is quite different if you chose different data-history length. From the attached notebook one can see, if I chose the date duration from 2017-07-05 to 2017-07-13, the RSI on 07-12 and 07-13 calculated from talib.RSI are 85.00772798 and 88.93115253. If I chose from 2017-06-25 to "2017-07-13, they are 89.75772863 and 92.51841015, though I use the same RSI-period.

My opinion: No matter what a length of date duration, if it's greater than the RSI-period (+1?), the RSI must be the same, right?

2 responses

I've searched in this forum and find out, if the length of the date-history should be rsi-period * 20, the result are the same.

The current rsi is calculated by combining the current rs with the previous rs. The previous rs is the previous combined with the orchids before that. The more data you give it the more accurate (or smoothed) it will be. Rsi calculation ideally uses more data than the rsi period.