TA-Lib
TA-Lib(Technical Analysis Library)是一个多平台的技术分析库,多种编程语言的开源API,包括C/C++、Java、Perl、Python版等。包含200多个技术指标,如ADX、MACD、RSI、布林带等,还支持烛台模式识别。Ta-Lib使用BSD许可,允许将它集成到您自己的开源或商业应用程序中。
TA-Lib的Python版本是使用 SWIG 封装C/C++版本的API,难安装,速度稍慢。开源项目mrjbq7/ta-lib使用Cython和Numpy封装TA-Lib的C/C++版,速度比TA-Lib的Python版快,所以在Python中一般使用该版本。
简介
时间轴
安装
使用pip安装
mrjbq7/ta-lib有发布在PyPI上,可以使用pip安装:
pip install TA-Lib
了解更多 >> mrjbq7/ta-lib:安装
故障排除
了解更多 >> mrjbq7/ta-lib:故障排除
函数
Overlap Studies 重叠指标
函数名 | 描述 | 代码 |
---|---|---|
MA Moving average |
移动平均线 按照计算方法可分多种,一般指简单移动平均(SMA)。 参数: matype:默认0(简单移动平均),0=SMA,1=EMA,2=WMA,3=DEMA,4=TEMA,5=TRIMA,6=KAMA,7=MAMA,8=T3 |
MA(close, timeperiod=30, matype=0) |
SMA Simple Moving Average |
简单移动平均 | SMA(close, timeperiod=30) |
EMA Exponential Moving Average |
指数移动平均 是以指数式递减加权的移动平均。 |
EMA(close, timeperiod=30) |
WMA Weighted Moving Average |
WMA(close, timeperiod=30) | |
DEMA Double Exponential Moving Average |
DEMA(close, timeperiod=30) | |
TEMA Triple Exponential Moving Average |
TEMA(close, timeperiod=30) | |
TRIMA Triangular Moving Average |
TRIMA(close, timeperiod=30) | |
KAMA Kaufman Adaptive Moving Average |
KAMA(close, timeperiod=30) | |
MAMA MESA Adaptive Moving Average |
mama, fama = MAMA(close, fastlimit=0, slowlimit=0) | |
T3 Triple Exponential Moving Average (T3) |
T3(close, timeperiod=5, vfactor=0) | |
BBANDS Bollinger Bands |
upperband, middleband, lowerband = BBANDS(close, timeperiod=5, nbdevup=2, nbdevdn=2, matype=0) | |
HT_TRENDLINE Hilbert Transform |
HT_TRENDLINE(close) | |
MAVP Moving average with variable period |
MAVP(close, periods, minperiod=2, maxperiod=30, matype=0) | |
MIDPOINT MidPoint over period |
MIDPOINT(close, timeperiod=14) | |
MIDPRICE Midpoint Price over period |
MIDPRICE(high, low, timeperiod=14) | |
SAR Parabolic SAR |
SAR(high, low, acceleration=0, maximum=0) | |
SAREXT Parabolic SAR |
SAREXT(high, low, startvalue=0, offsetonreverse=0, accelerationinitlong=0, accelerationlong=0, accelerationmaxlong=0, accelerationinitshort=0, accelerationshort=0, accelerationmaxshort=0) |