Reputation: 23
I would like a python function that would operate similar to: talib.RSI() (https://mrjbq7.github.io/ta-lib/)
The feature that I am looking for is that I can have it in a loop and just feed it the latest stock close price, and it would output the current RSI value. Also no forever growing stock price list would have to be maintained inside our outside of the function.
If anyone can direct me to such or how to build it, I would be very grateful.
Thanks
Upvotes: 1
Views: 1942
Reputation: 3111
TA-Lib for python is just a wrapper for TA-Lib library written in C. This library doesn't support incremental calculation of indicators. It requires whole data at once. But there is a fork of TA-Lib - TA-Lib RT that introduces such functionality. Being a fork it's written in C language too and thus requires a python wrapper to be used from Python application. There is experimental adaptation of a original TA-Lib's python wrapper to TA-Lib RT here and related discussion here. You may try to set it up but note performance issues discussion at the end of the thread. You may need *BatchState functions instead of *State.
Or you may look for some python library not based on TA-Lib. I heard about talipp as an alternative. You may check its RSI implementation sources for example.
Upvotes: 2