Let us just say I have a list of closing price data for an asset:
priceList = [3,1,2,1,2,1,2,1,2,1,2]
How do I get the RSI value for the last closing price of priceList? Currently, I am having this code:
import talib
import numpy
priceList = [1,2,1,2,1,2,1,2,1,2]
print(talib.RSI(priceList, timeperiod=10))
But, it's giving me this error:
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got list)
Please help me solve! Thanks.