使用从 yahoo Finance 下载的 python pandas 数据框 (d),其格式为:
日期,开盘,高,低,收盘,成交量,调整收盘 2015-01-13,1.290,1.290,1.200,1.225,421600,1.225
我可以成功地使用这样的 talib 函数:
talib.abstract.EMA(d, timeperiod=8, price='Close')
talib.abstract.SMA(d, timeperiod=13, price='Close')
talib.abstract.RSI(d, timeperiod=25, price='Close')
从文档(http://mrjbq7.github.io/ta-lib/func_groups/momentum_indicators.html)中,它们采用以下形式:
real = XYZ(close, timeperiod=14)
但是,当尝试将 talib 函数与表单一起使用时:
real = XYZ(high, low, close, timeperiod=14) such as the ADX I cant figure out the correct syntax needed.
我试过这个:
talib.abstract.ADX(d,high='High',low='Low',close='Close',Timeperiod=10)
例外:input_arrays 参数缺少必需的数据键:高、低、关闭
和这个:
talib.abstract.ADX(high=d.High,low=d.Low,close=d.Close,Timeperiod=10)
TypeError: only length-1 arrays can be converted to Python scalars
关于此参数所需参数的正确格式以及具有多个输入参数的其他 talib python 包装器的任何想法?
任何有关正确格式的帮助将不胜感激!!!提前致谢