【发布时间】:2020-05-05 14:16:36
【问题描述】:
假设我有一个资产的收盘价数据列表:
priceList = [3,1,2,1,2,1,2,1,2,1,2]
如何获取 priceList 的最后收盘价的 RSI 值? 目前,我有这个代码:
import talib
import numpy
priceList = [1,2,1,2,1,2,1,2,1,2]
print(talib.RSI(priceList, timeperiod=10))
但是,它给了我这个错误:
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got list)
请帮我解决!谢谢。
【问题讨论】:
标签: python indicator forex ta-lib