Skip to content

3. Adding Indicators

Ruben edited this page Mar 3, 2018 · 3 revisions

Technify uses the ta-lib library so the algorithms provided are the ones described in their repository documentation.

from technify import indicators

The indicators can be added by means of the append function, the signature is the same for all of them:

  1. the indicator function name
  2. list containing the input columns for the indicator
  3. map of parameters to overwrite (optional)
  4. saveas parameter with a list of column names that will overwrite the default generated columns.

Example:

msft = Stock.fromQuandl("EOD/MSFT")\
        .append(ov.ema, "Open", timeperiod=40)   # stores the result as 'ema'
msft = Stock.fromQuandl("EOD/MSFT")\
        .append(ov.bbands,"Close", saveas=["low", "medium", "high"])  # custom Bollinger bands

The following list contains the available functions in Indicators module:

from technify import indicators 
Function Name Description Default output colums
bbands Bollinger Bands bbands_lb, bbands_mb, bbands_ub
dema Double Exponential Moving Average dema
ema Exponential Moving Average ema
trendline Hilbert Transform - Instantaneous Trendline trendline
kama Kaufman Adaptive Moving Average kama
ma Moving average ma
mama MESA Adaptive Moving Average mama, fama
mavp Moving average with variable period mavp
midpoint MidPoint over period midpoint
midprice Midpoint Price over period midprice
sar Parabolic SAR sar
sarext Parabolic SAR - Extended sarext
sma Simple Moving Average sma
t3 Triple Exponential Moving Average (T3) t3
tema Triple Exponential Moving Average tema
trima Triangular Moving Average trima
wma Weighted Moving Average wma
------ Momentum Indicators ------
adx Average Directional Movement Index adx
adxr Average Directional Movement Index Rating adxr
apo Absolute Price Oscillator apo
aroon Aroon aroon
aroonosc Aroon Oscillator aroondown, aroonup
bop Balance Of Power bop
cci Commodity Channel Index cci
com Chande Momentum Oscillator cmo
dx Directional Movement Index dx
macd Moving Average Convergence/Divergence macd, macdsignal, macdhist
macdext MACD with controllable MA type macd, macdsignal, macdhist
macdfix MACD Fix 12/26 macdsignal, macdhist
mfi Money Flow Index mfi
minus_di Minus Directional Indicator minus_di
minus_dm Minus Directional Movement minus_dm
mom Momentum mom
plus_di Plus Directional Indicator plus_di
plus_dm Plus Directional Movement plus_dm
ppo Percentage Price Oscillator ppo
roc Rate of change : ((price/prevPrice)-1)*100 roc
rocp Rate of change Percentage rocp
rocr Rate of change ratio: (price/prevPrice) rocr
rocr100 Rate of change ratio 100 scale rocr100
rsi Relative Strength Index rsi
stoch Stochastic slowk, slowd
stochf Stochastic Fast fastk, fastd
stochrsi Stochastic Relative Strength Index fastk, fastd
trix 1-day Rate-Of-Change (ROC) trix
ultosc Ultimate Oscillator ultosc
willr Williams' %R willr
------ Volume Indicators ------
ad Chaikin A/D Line ad
adosc Chaikin A/D Oscillator adosc
obv On Balance Volume obv
------ Volatility Indicators ------
atr Average True Range atr
natr Normalized Average True Range natr
trange True Range trange
------ Cycle Indicators ------
ht_dcperiod Hilbert Transform - Dominant Cycle Period ht_dcperiod
ht_dcphase Hilbert Transform - Dominant Cycle Phase ht_dcphase
ht_phasor Hilbert Transform - Phasor Components inphase, quadrature
ht_sine Hilbert Transform - SineWave sine, leadsine
ht_trendmode Hilbert Transform - Trend vs Cycle Mode ht_trendmode

Clone this wiki locally