Skip to content
saviornt edited this page Aug 22, 2024 · 8 revisions

Overview

Please note that this Wiki is still in the process of being updated!

Introduction

Installation

Install PyTA using the terminal command:
pip install git+https://github.com/saviornt/PyTA

Getting Started

Basic Usage

import pyta
import pandas as pd
import numpy as np

dates = pd.date_range(start='2023-01-01', end='2023-01-31', freq='D')
np.random.seed(42)

data = {
    'Date': dates,
    'Open': np.random.uniform(100, 200, size=len(dates)),
    'High': np.random.uniform(200, 250, size=len(dates)),
    'Low': np.random.uniform(80, 100, size=len(dates)),
    'Close': np.random.uniform(100, 200, size=len(dates)),
    'Volume': np.random.randint(1000, 5000, size=len(dates))
}

df = pd.DataFrame(data)

df.set_index('Date', inplace=True)

df['EMA'] = pyta.EMA(data)
df['RSI'] = pyta.RSI(data)
df['VWAP'] = pyta.VWAP(data)

Technical Indicators

In order to make this Python library as easy to use as possible and since TA-Lib has been used for financial analysis for so long, PyTA uses the same naming conventions and indicator placements as TA-Lib does. There is an additional group and indicators used for options trading as well.

Indicator Groups

There are eight different indicator groups:

Indicator Functions

Overlap Studies

  • BBANDS: Bollinger Bands
  • DEMA: Double Exponential Moving Average
  • EMA: Exponential Moving Average
  • HT_TRENDLINE: Hilbert Transform - Instantaneous Trendline
  • KAMA: Kaufman Adaptive Moving Average
  • MA: Moving average using a specified method
  • MAMA: MESA Adaptive Moving Average
  • MAVP: Moving average with variable period
  • MIDPOINT: Midpoint over period
  • MIDPRICE: Midpoint Price over period
  • SAR: Parabolic SAR
  • SAREXT: Parabolic SAR - Extended
  • SMA: Simple Moving Average
  • T3: Triple Exponential Moving Average (T3)
  • TEMA: Triple Exponential Moving Average
  • TRIMA: Triangular Moving Average
  • WMA: Weighted Moving Average

Momentum Indicators

  • ADX:
  • ADXR:
  • APO:
  • AROON:
  • AROONOSC:
  • BOP:
  • CCI:
  • CMO:
  • COP:
  • DX:
  • MACD:
  • MACDEXT:
  • MACDFIX:
  • MFI:
  • MINUS_DI:
  • MINUS_DM:
  • MOM:
  • PLUS_DI:
  • PLUS_DM:
  • PPO:
  • ROC:
  • ROCP:
  • ROCR:
  • ROCR100:
  • RSI:
  • STOCH:
  • STOCHRSI:
  • TRIX:
  • ULTOSC:
  • WILLR:

Volume Indicators

  • AD: Chaikin A/D Line
  • ADL: Accumulation/Distribution Line
  • ADOSC: Chaikin A/D Oscillator
  • OBV: On-Balance Volume
  • VWAP: Volume Weighted Average Price

Cycle Indicators

  • HT_DCPERIOD: Hilbert Transform Dominant Cycle Period
  • HT_DCPHASE: Hilbert Transform Dominate Cycle Phase
  • HT_PHASOR: Hilbert Transform Phasor
  • HT_SINE: Hilbert Transform Sine
  • HT_TRENDMODE: Hilbert Transform Trend Mode

Price Transform

  • AVGPRICE: Average Price
  • MEDPRICE: Median Price
  • PP: Pivot Points
  • TYPPRICE: Typical Price
  • WCLPRICE: Weighted Close Price

Volatility Indicators

  • ATR: Average True Range
  • NATR: Normalized Average True Range
  • TRANGE: True Range

Statistical Functions

  • BETA: Beta
  • CORREL: Pearson's Correlation Coefficient (r)
  • LINEARREG: Linear Regression
  • LINEARREG_ANGLE: Linear Regression Angle
  • LINEARREG_INTERCEPT: Linear Regression Intercept
  • LINEARREG_SLOPE: Linear Regression Slope
  • STDDEV: Standard Deviation
  • TSF: Time Series Forecast
  • VAR: Variance

Options Indicators

  • DELTA: Delta
  • GAMMA: Gamma
  • HV: Historical Volatility
  • IVBINOMIAL: Implied Volatility using the Binomial model
  • IVBLACKSCHOLES: Implied Volatility using the Black-Scholes model
  • PCR: Put-Call Ratio
  • RHO: Rho
  • THETA: Theta
  • VEGA: Vega
  • VS: Volatility Skew

Candle Patterns

  • CDL2CROWS:
  • CDL3BLACKCROWS:
  • CDL3INSIDE:
  • CDL3LINESTRIKE:
  • CDL3OUTSIDE:
  • CDL3STARSINSOUTH:
  • CDL3WHITESOLDIERS:
  • CDLABANDONEDBABY:
  • CDLADVANCEBLOCK:
  • CDLBELTHOLD:
  • CDLBREAKAWAY:
  • CDLCLOSINGMARUBOZU:
  • CDLCONCEALBABYSWALL:
  • CDLCOUNTERATTACK:
  • CDLDARKCLOUDCOVER:
  • CDLDOJI:
  • CDLDOJISTAR:
  • CDLDRAGONFLYDOJI:
  • CDLENGULFING:
  • CDLEVENINGDOJISTAR:
  • CDLEVENINGSTAR:
  • CDLGAPSIDESIDEWHITE:
  • CDLGRAVESTONEDOJI:
  • CDLHAMMER:
  • CDLHANGINGMAN:
  • CDLHARAMI:
  • CDLHARAMICROSS:
  • CDLHIGHWAVE:
  • CDLHIKKAKE:
  • CDLHIKKAKEMOD:
  • CDLHOMINGPIGEON:
  • CDLIDENTICAL3CROWS:
  • CDLINNECK:
  • CDLINVERTEDHAMMER:
  • CDLKICKING:
  • CDLKICKINGBYLENGTH:
  • CDLLADDERBOTTOM:
  • CDLLONGLEGGEDDOJI:
  • CDLMARUBOZU:
  • CDLMASTAR:
  • CDLMATHOLD:
  • CDLMEETINGLINES:
  • CDLMORNINGDOJISTAR:
  • CDLMORNINGSTAR:
  • CDLONNECK:
  • CDLOPENINGMARUBOZU:
  • CDLOVERLAPPING:
  • CDLPIERCING:
  • CDLPREGNANT:
  • CDLRICKSHAWMAN:
  • CDLRISEFALL3METHODS:
  • CDLSEPARATINGLINES:
  • CDLSHOOTINGSTAR:
  • CDLSHORTLINE:
  • CDLSPINNINGTOP:
  • CDLSTALLEDPATTERN:
  • CDLSTICKSANDWICH:
  • CDLSTICKSWITHIN:
  • CDLTAKURI:
  • CDLTASUKIGAP:
  • CDLTHRUSTING:
  • CDLTRISTAR:
  • CDLUNIQUE3RIVER:
  • CDLUPSIDEGAP2CROWS:
  • CDLVALE:
  • CDLVARIETY:
  • CDLWHITESOLDIER:
  • CDLXSIDEGAP3METHODS:

Contributing

Troubleshooting

Changelog

License

Contact