pytafast module

pytafast.ACOS(inReal)

Vector ACOS.

pytafast.AD(inHigh, inLow, inClose, inVolume)[source]

Chaikin A/D Line.

pytafast.ADD(inReal0, inReal1)

ADD indicator.

pytafast.ADOSC(inHigh, inLow, inClose, inVolume, fastperiod=3, slowperiod=10)[source]

Chaikin A/D Oscillator.

pytafast.ADX(inHigh, inLow, inClose, timeperiod=14)

ADX indicator.

pytafast.ADXR(inHigh, inLow, inClose, timeperiod=14)

ADXR indicator.

pytafast.ALMA(inReal, timeperiod=9, offset=0.85, sigma=6.0)[source]

Arnaud Legoux Moving Average.

pytafast.APO(inReal, fastperiod=12, slowperiod=26, matype=0)[source]

Absolute Price Oscillator.

pytafast.AROON(inHigh, inLow, timeperiod=14)[source]

Aroon. Returns: (aroondown, aroonup)

pytafast.AROONOSC(inHigh, inLow, timeperiod=14)

AROONOSC indicator.

pytafast.ASIN(inReal)

Vector ASIN.

pytafast.ATAN(inReal)

Vector ATAN.

pytafast.ATR(inHigh, inLow, inClose, timeperiod=14)

ATR indicator.

pytafast.AVGDEV(inReal, timeperiod=14)

AVGDEV indicator.

pytafast.AVGPRICE(inOpen, inHigh, inLow, inClose)[source]

Average Price.

pytafast.BBANDS(inReal, timeperiod=5, nbdevup=2.0, nbdevdn=2.0, matype=MAType.SMA)[source]

Bollinger Bands. Returns: (upperband, middleband, lowerband)

pytafast.BETA(inReal0, inReal1, timeperiod=5)

BETA indicator.

pytafast.BOP(inOpen, inHigh, inLow, inClose)[source]

Balance Of Power.

pytafast.CCI(inHigh, inLow, inClose, timeperiod=14)

CCI indicator.

pytafast.CDL2CROWS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL2CROWS

pytafast.CDL3BLACKCROWS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3BLACKCROWS

pytafast.CDL3INSIDE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3INSIDE

pytafast.CDL3LINESTRIKE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3LINESTRIKE

pytafast.CDL3OUTSIDE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3OUTSIDE

pytafast.CDL3STARSINSOUTH(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3STARSINSOUTH

pytafast.CDL3WHITESOLDIERS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDL3WHITESOLDIERS

pytafast.CDLABANDONEDBABY(inOpen, inHigh, inLow, inClose, penetration=0.3)

Candlestick Pattern: CDLABANDONEDBABY

pytafast.CDLADVANCEBLOCK(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLADVANCEBLOCK

pytafast.CDLBELTHOLD(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLBELTHOLD

pytafast.CDLBREAKAWAY(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLBREAKAWAY

pytafast.CDLCLOSINGMARUBOZU(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLCLOSINGMARUBOZU

pytafast.CDLCONCEALBABYSWALL(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLCONCEALBABYSWALL

pytafast.CDLCOUNTERATTACK(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLCOUNTERATTACK

pytafast.CDLDARKCLOUDCOVER(inOpen, inHigh, inLow, inClose, penetration=0.5)

Candlestick Pattern: CDLDARKCLOUDCOVER

pytafast.CDLDOJI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLDOJI

pytafast.CDLDOJISTAR(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLDOJISTAR

pytafast.CDLDRAGONFLYDOJI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLDRAGONFLYDOJI

pytafast.CDLENGULFING(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLENGULFING

pytafast.CDLEVENINGDOJISTAR(inOpen, inHigh, inLow, inClose, penetration=0.3)

Candlestick Pattern: CDLEVENINGDOJISTAR

pytafast.CDLEVENINGSTAR(inOpen, inHigh, inLow, inClose, penetration=0.3)

Candlestick Pattern: CDLEVENINGSTAR

pytafast.CDLGAPSIDESIDEWHITE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLGAPSIDESIDEWHITE

pytafast.CDLGRAVESTONEDOJI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLGRAVESTONEDOJI

pytafast.CDLHAMMER(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHAMMER

pytafast.CDLHANGINGMAN(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHANGINGMAN

pytafast.CDLHARAMI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHARAMI

pytafast.CDLHARAMICROSS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHARAMICROSS

pytafast.CDLHIGHWAVE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHIGHWAVE

pytafast.CDLHIKKAKE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHIKKAKE

pytafast.CDLHIKKAKEMOD(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHIKKAKEMOD

pytafast.CDLHOMINGPIGEON(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLHOMINGPIGEON

pytafast.CDLIDENTICAL3CROWS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLIDENTICAL3CROWS

pytafast.CDLINNECK(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLINNECK

pytafast.CDLINVERTEDHAMMER(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLINVERTEDHAMMER

pytafast.CDLKICKING(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLKICKING

pytafast.CDLKICKINGBYLENGTH(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLKICKINGBYLENGTH

pytafast.CDLLADDERBOTTOM(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLLADDERBOTTOM

pytafast.CDLLONGLEGGEDDOJI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLLONGLEGGEDDOJI

pytafast.CDLLONGLINE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLLONGLINE

pytafast.CDLMARUBOZU(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLMARUBOZU

pytafast.CDLMATCHINGLOW(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLMATCHINGLOW

pytafast.CDLMATHOLD(inOpen, inHigh, inLow, inClose, penetration=0.5)

Candlestick Pattern: CDLMATHOLD

pytafast.CDLMORNINGDOJISTAR(inOpen, inHigh, inLow, inClose, penetration=0.3)

Candlestick Pattern: CDLMORNINGDOJISTAR

pytafast.CDLMORNINGSTAR(inOpen, inHigh, inLow, inClose, penetration=0.3)

Candlestick Pattern: CDLMORNINGSTAR

pytafast.CDLONNECK(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLONNECK

pytafast.CDLPIERCING(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLPIERCING

pytafast.CDLRICKSHAWMAN(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLRICKSHAWMAN

pytafast.CDLRISEFALL3METHODS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLRISEFALL3METHODS

pytafast.CDLSEPARATINGLINES(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSEPARATINGLINES

pytafast.CDLSHOOTINGSTAR(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSHOOTINGSTAR

pytafast.CDLSHORTLINE(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSHORTLINE

pytafast.CDLSPINNINGTOP(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSPINNINGTOP

pytafast.CDLSTALLEDPATTERN(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSTALLEDPATTERN

pytafast.CDLSTICKSANDWICH(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLSTICKSANDWICH

pytafast.CDLTAKURI(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLTAKURI

pytafast.CDLTASUKIGAP(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLTASUKIGAP

pytafast.CDLTHRUSTING(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLTHRUSTING

pytafast.CDLTRISTAR(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLTRISTAR

pytafast.CDLUNIQUE3RIVER(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLUNIQUE3RIVER

pytafast.CDLUPSIDEGAP2CROWS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLUPSIDEGAP2CROWS

pytafast.CDLXSIDEGAP3METHODS(inOpen, inHigh, inLow, inClose)

Candlestick Pattern: CDLXSIDEGAP3METHODS

pytafast.CEIL(inReal)

Vector CEIL.

pytafast.CMF(inHigh, inLow, inClose, inVolume, timeperiod=20)[source]

Chaikin Money Flow.

pytafast.CMO(inReal, timeperiod=14)

CMO indicator.

pytafast.CORREL(inReal0, inReal1, timeperiod=30)

CORREL indicator.

pytafast.COS(inReal)

Vector COS.

pytafast.COSH(inReal)

Vector COSH.

class pytafast.Chart(df, date_col='Date', open_col='Open', high_col='High', low_col='Low', close_col='Close', vol_col='Volume')[source]

Bases: object

A quantmod-inspired chaining chart builder for pytafast using Plotly.

THEMES = {'dark': 'plotly_dark', 'ggplot2': 'ggplot2', 'light': 'plotly_white', 'seaborn': 'seaborn', 'simple': 'simple_white'}
add_adx(n=14, height=0.2)[source]
add_alma(n=9, offset=0.85, sigma=6.0)[source]
add_aroon(n=14, height=0.2)[source]
add_atr(n=14, height=0.15)[source]
add_bbands(n=20, sd=2.0, color='rgba(173, 216, 230, 0.15)')[source]
add_candlestick(name='Price')[source]
add_cci(n=14, height=0.2)[source]
add_chaikin_osc(fast=3, slow=10, height=0.2)[source]
add_clv(height=0.15)[source]
add_cmf(n=20, height=0.2)[source]
add_cmo(n=14, height=0.2)[source]
add_dema(n=20, color='#e31a1c')[source]
add_donchian(n=10)[source]
add_dpo(n=10, height=0.2)[source]
add_ema(n=20, color='#5d62b5')[source]
add_emv(n=9, height=0.2)[source]
add_envelope(n=20, p=2.5, color='rgba(0, 0, 255, 0.1)')[source]

Add Moving Average Envelope around SMA.

add_evwma(n=30)[source]
add_hline(y, color='gray', dash='dash')[source]

Add a horizontal line to the main chart.

add_hma(n=20, color='#b15928')[source]
add_ichimoku(n1=9, n2=26, n3=52)[source]

Add Ichimoku Kinko Hyo (Cloud) to the main chart.

add_kama(n=20, color='#6a3d9a')[source]
add_keltner(n=20, mult=2.0)[source]
add_kst(height=0.2)[source]
add_last(color='red')[source]

Add a horizontal line at the last closing price.

add_line(name='Close Price', color=None)[source]
add_macd(f=12, s=26, sig=9, height=0.2)[source]
add_mfi(n=14, height=0.2)[source]
add_momentum(n=10, height=0.2)[source]
add_obv(height=0.15)[source]
add_patterns()[source]

Automatically find and label all recognized candlestick patterns.

add_points(x, y, name='Points', color='black', symbol='circle', size=8)[source]

Add custom scatter points to the main chart.

add_roc(n=10, height=0.2)[source]
add_rsi(n=14, height=0.2)[source]
add_sar(accel=0.02, max_step=0.2)[source]
add_shading(start, end, color='rgba(128, 128, 128, 0.2)')[source]

Highlight a vertical time region (start/end can be dates or indices).

add_sma(n=20, color='#f29d4b')[source]
add_smi(n=13, nFast=2, nSlow=25, nSig=9, height=0.2)[source]
add_stoch(k=5, d=3, height=0.2)[source]
add_tdi(n=13, rsi_ma1=2, rsi_ma2=7, bb_n=34, bb_sd=1.6185, height=0.25)[source]

Traders Dynamic Index (TDI).

add_tema(n=20, color='#fb9a99')[source]
add_text(x, y, text, color='black', position='top center')[source]

Add custom text annotations to the main chart.

add_trix(n=30, height=0.2)[source]
add_vline(x, color='gray', dash='dash')[source]

Add a vertical line to the main chart.

add_volatility(n=10, height=0.2)[source]

Chaikin Volatility: percent change in EMA of (High-Low) range.

add_volume(height=0.15)[source]
add_willr(n=14, height=0.2)[source]
add_wma(n=20, color='#33a02c')[source]
add_zigzag(change=5.0, percent=True)[source]
add_zlema(n=30)[source]
render()[source]
save_html(filename='chart.html')[source]
save_image(filename='chart.png', w=1200, h=800)[source]

Renders and saves the chart to a static image (PNG, JPG, PDF, SVG). Requires ‘kaleido’ package (pip install kaleido).

set_theme(theme_name)[source]

Set the chart theme (light, dark, ggplot2, seaborn).

show()[source]
pytafast.DEMA(inReal, timeperiod=30)

DEMA indicator.

pytafast.DIV(inReal0, inReal1)

DIV indicator.

pytafast.DPO(inReal, timeperiod=10)[source]

Detrended Price Oscillator.

pytafast.DX(inHigh, inLow, inClose, timeperiod=14)

DX indicator.

pytafast.DonchianChannel(inHigh, inLow, timeperiod=10)[source]

Donchian Channel. Returns: (upper, middle, lower)

pytafast.EMA(inReal, timeperiod=30)

EMA indicator.

pytafast.EMV(inHigh, inLow, inVolume, timeperiod=9, vol_divisor=10000.0)[source]

Arms’ Ease of Movement Value. Returns: (emv, smoothed_emv)

pytafast.EVWMA(inReal, inVolume, timeperiod=30)[source]

Elastic Volume Weighted Moving Average.

pytafast.EXP(inReal)

Vector EXP.

pytafast.FLOOR(inReal)

Vector FLOOR.

pytafast.GMMA(inReal)[source]

Guppy Multiple Moving Average. Returns a tuple of 12 EMA series.

pytafast.HMA(inReal, timeperiod=20)[source]

Hull Moving Average.

pytafast.HT_DCPERIOD(inReal)

HT_DCPERIOD indicator.

pytafast.HT_DCPHASE(inReal)

HT_DCPHASE indicator.

pytafast.HT_PHASOR(inReal)[source]

Hilbert Transform - Phasor Components.

pytafast.HT_SINE(inReal)[source]

Hilbert Transform - SineWave.

pytafast.HT_TRENDLINE(inReal)

HT_TRENDLINE indicator.

pytafast.HT_TRENDMODE(inReal)

HT_TRENDMODE indicator.

pytafast.KAMA(inReal, timeperiod=30)

KAMA indicator.

pytafast.KST(inReal, nROC1=10, nROC2=15, nROC3=20, nROC4=30, nAvg1=10, nAvg2=10, nAvg3=10, nAvg4=15, nSig=9)[source]

Know Sure Thing (KST). Returns: (kst, signal)

pytafast.LINEARREG(inReal, timeperiod=14)

LINEARREG indicator.

pytafast.LINEARREG_ANGLE(inReal, timeperiod=14)

LINEARREG_ANGLE indicator.

pytafast.LINEARREG_INTERCEPT(inReal, timeperiod=14)

LINEARREG_INTERCEPT indicator.

pytafast.LINEARREG_SLOPE(inReal, timeperiod=14)

LINEARREG_SLOPE indicator.

pytafast.LN(inReal)

Vector LN.

pytafast.LOG10(inReal)

Vector LOG10.

pytafast.MA(inReal, timeperiod=30, matype=0)[source]

Moving Average (generic).

pytafast.MACD(inReal, fastperiod=12, slowperiod=26, signalperiod=9)[source]

Moving Average Convergence/Divergence. Returns: (macd, signal, hist)

pytafast.MACDEXT(inReal, fastperiod=12, fastmatype=0, slowperiod=26, slowmatype=0, signalperiod=9, signalmatype=0)[source]

MACD with controllable MA type.

pytafast.MACDFIX(inReal, signalperiod=9)[source]

MACD Fix 12/26.

pytafast.MAMA(inReal, fastlimit=0.5, slowlimit=0.05)[source]

MESA Adaptive Moving Average. Returns: (mama, fama)

class pytafast.MAType(*values)

Bases: Enum

DEMA = 3
EMA = 1
KAMA = 6
MAMA = 7
SMA = 0
T3 = 8
TEMA = 4
TRIMA = 5
WMA = 2
pytafast.MAX(inReal, timeperiod=30)

MAX indicator.

pytafast.MEDPRICE(inReal0, inReal1)

MEDPRICE indicator.

pytafast.MFI(inHigh, inLow, inClose, inVolume, timeperiod=14)[source]

Money Flow Index.

pytafast.MIDPOINT(inReal, timeperiod=14)

MIDPOINT indicator.

pytafast.MIDPRICE(inHigh, inLow, timeperiod=14)

MIDPRICE indicator.

pytafast.MIN(inReal, timeperiod=30)

MIN indicator.

pytafast.MINMAX(inReal, timeperiod=30)[source]

Lowest and highest values over a specified period.

pytafast.MINMAXINDEX(inReal, timeperiod=30)[source]

Indexes of lowest and highest values over a specified period.

pytafast.MINUS_DI(inHigh, inLow, inClose, timeperiod=14)

MINUS_DI indicator.

pytafast.MINUS_DM(inHigh, inLow, timeperiod=14)

MINUS_DM indicator.

pytafast.MOM(inReal, timeperiod=10)

MOM indicator.

pytafast.MULT(inReal0, inReal1)

MULT indicator.

pytafast.NATR(inHigh, inLow, inClose, timeperiod=14)

NATR indicator.

pytafast.OBV(inReal0, inReal1)

OBV indicator.

pytafast.PLUS_DI(inHigh, inLow, inClose, timeperiod=14)

PLUS_DI indicator.

pytafast.PLUS_DM(inHigh, inLow, timeperiod=14)

PLUS_DM indicator.

pytafast.PPO(inReal, fastperiod=12, slowperiod=26, matype=0)[source]

Percentage Price Oscillator.

pytafast.ROC(inReal, timeperiod=10)

ROC indicator.

pytafast.ROCP(inReal, timeperiod=10)

ROCP indicator.

pytafast.ROCR(inReal, timeperiod=10)

ROCR indicator.

pytafast.ROCR100(inReal, timeperiod=10)

ROCR100 indicator.

pytafast.RSI(inReal, timeperiod=14)

RSI indicator.

pytafast.SAR(inHigh, inLow, acceleration=0.02, maximum=0.2)[source]

Parabolic SAR.

pytafast.SIN(inReal)

Vector SIN.

pytafast.SINH(inReal)

Vector SINH.

pytafast.SMA(inReal, timeperiod=30)

SMA indicator.

pytafast.SMI(inHigh, inLow, inClose, n=13, nFast=2, nSlow=25, nSig=9)[source]

Stochastic Momentum Index. Returns: (smi, signal)

pytafast.SNR(inHigh, inLow, inClose, timeperiod=14)[source]

Signal to Noise Ratio.

pytafast.SQRT(inReal)

Vector SQRT.

pytafast.STDDEV(inReal, timeperiod=5, nbdev=1.0)[source]

Standard Deviation.

pytafast.STOCH(inHigh, inLow, inClose, fastk_period=5, slowk_period=3, slowk_matype=MAType.SMA, slowd_period=3, slowd_matype=MAType.SMA)[source]

Stochastic. Returns: (slowk, slowd)

pytafast.STOCHF(inHigh, inLow, inClose, fastk_period=5, fastd_period=3, fastd_matype=0)[source]

Stochastic Fast.

pytafast.STOCHRSI(inReal, timeperiod=14, fastk_period=5, fastd_period=3, fastd_matype=0)[source]

Stochastic RSI.

pytafast.SUB(inReal0, inReal1)

SUB indicator.

pytafast.SUM(inReal, timeperiod=30)

SUM indicator.

pytafast.T3(inReal, timeperiod=5, vfactor=0.7)[source]

Triple Exponential Moving Average (T3).

pytafast.TAN(inReal)

Vector TAN.

pytafast.TANH(inReal)

Vector TANH.

pytafast.TEMA(inReal, timeperiod=30)

TEMA indicator.

pytafast.TRANGE(inHigh, inLow, inClose)[source]

True Range.

pytafast.TRIMA(inReal, timeperiod=30)

TRIMA indicator.

pytafast.TRIX(inReal, timeperiod=30)

TRIX indicator.

pytafast.TSF(inReal, timeperiod=14)

TSF indicator.

pytafast.TYPPRICE(inHigh, inLow, inClose)[source]

Typical Price.

pytafast.ULTOSC(inHigh, inLow, inClose, timeperiod1=7, timeperiod2=14, timeperiod3=28)[source]

Ultimate Oscillator.

pytafast.VAR(inReal, timeperiod=5, nbdev=1.0)[source]

Variance.

pytafast.VHF(inReal, timeperiod=28)[source]

Vertical Horizontal Filter.

pytafast.WCLPRICE(inHigh, inLow, inClose)[source]

Weighted Close Price.

pytafast.WILLR(inHigh, inLow, inClose, timeperiod=14)

WILLR indicator.

pytafast.WMA(inReal, timeperiod=30)

WMA indicator.

pytafast.ZIGZAG(inHigh, inLow, change=10.0, percent=True)[source]

ZigZag indicator.

pytafast.ZLEMA(inReal, timeperiod=30)[source]

Zero Lag Exponential Moving Average.

pytafast.keltnerChannels(inHigh, inLow, inClose, timeperiod=20, atr_mult=2.0)[source]

Keltner Channels. Returns: (upper, middle, lower)