Eka*_*Eka 9 python pandas ta-lib technical-indicator
我是python和pandas的新手,主要是学习它以使我的编程技能多样化以及python作为通用程序语言的优势.在这个程序中,我使用它从雅虎获取历史数据,并使用talib中的函数进行一些技术分析
import pandas_datareader.data as web
import datetime
import talib as ta
start = datetime.datetime.strptime('12/1/2015', '%m/%d/%Y')
end = datetime.datetime.strptime('2/20/2016', '%m/%d/%Y')
f = web.DataReader('GOOG', 'yahoo', start, end)
print 'Closing Prices'
print f['Close'].describe()
print f.Close
print ta.RSI(f.Close,2)
print ta.SMA(f.Close,2)
print ta.SMA(f.Volume,4)
print ta.ATR
print ta.ATR(f.High,f.Low,f.Close,3)
Run Code Online (Sandbox Code Playgroud)
上面的代码工作,print f.Close但它显示此错误
print ta.RSI(f.Close,2)
TypeError: Argument 'real' has incorrect type (expected numpy.ndarray, got Series)
Run Code Online (Sandbox Code Playgroud)
我使用R及其库进行库存技术分析,它有一个内置的库Quantmod,可以使技术分析更容易,代码更少.
library(quantmod)
symbol=getSymbols(AAPL)
SMA=SMA(Cl(Symbol),2)
Run Code Online (Sandbox Code Playgroud)
是否有类似的Python可用的库?
| 归档时间: |
|
| 查看次数: |
12039 次 |
| 最近记录: |