原文地址: TA-LIB document
翻譯地址:https://github.com/HuaRongSAO/talib-document
Function API Examples
Similar to TA-Lib, the function interface provides a lightweight wrapper of
the exposed TA-Lib indicators.
類似于TA庫狞膘,對(duì)函數(shù)接口進(jìn)行了一個(gè)輕量級(jí)的封裝芋浮,用于公開的ta-lib的指標(biāo)。
Each function returns an output array and have default values for their
parameters, unless specified as keyword arguments. Typically, these functions
will have an initial "lookback" period (a required number of observations
before an output is generated) set to NaN
.
每個(gè)函數(shù)都默認(rèn)需要輸入數(shù)組之拨,并為它們提供默認(rèn)值。 參數(shù)慢显,除非指定為關(guān)鍵字參數(shù)传黄。通常,這些函數(shù) 會(huì)有一個(gè)初步的“l(fā)ookback”時(shí)期(觀測(cè)所需數(shù)量 在生成一個(gè)輸出之前)戴涝,設(shè)置為“NaN”。
All of the following examples use the function API:
所有的API函數(shù)的使用,都需引入庫文件:
import numpy
import talib
close = numpy.random.random(100)
計(jì)算收盤價(jià)的一個(gè)簡(jiǎn)單移動(dòng)平均數(shù)SMA:
output = talib.SMA(close)
計(jì)算布林線啥刻,三指數(shù)移動(dòng)平均:
from talib import MA_Type
upper, middle, lower = talib.BBANDS(close, matype=MA_Type.T3)
計(jì)算收盤價(jià)的動(dòng)量奸鸯,時(shí)間為5:
output = talib.MOM(close, timeperiod=5)
方法類型分組: