Need help with ta?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

bukosabino
2.0K Stars 512 Forks MIT License 582 Commits 82 Opened issues

Description

Technical Analysis Library using Pandas and Numpy

Services available

!
?

Need anything else?

Contributors list

# 11,877
pandas
python3
volatil...
fundame...
402 commits
# 24,865
Python
Jupyter...
pandas
python3
31 commits
# 127,200
Python
Jupyter...
pandas
python3
7 commits
# 27,306
python3
volatil...
fundame...
Apache ...
7 commits
# 147,614
Python
Jupyter...
pandas
python3
5 commits
# 161,863
Python
Jupyter...
pandas
python3
4 commits
# 181,989
Python
Jupyter...
pandas
python3
3 commits
# 182,126
Python
Jupyter...
pandas
python3
3 commits
# 186,981
Jupyter...
pandas
python3
volatil...
2 commits
# 212,083
Python
Jupyter...
pandas
python3
2 commits
# 211,069
Python
Jupyter...
pandas
python3
2 commits
# 267,839
Jupyter...
pandas
python3
volatil...
1 commit
# 148,221
Jupyter...
pandas
python3
volatil...
1 commit
# 183,674
Python
Jupyter...
pandas
python3
1 commit
# 269,429
Python
Jupyter...
pandas
python3
1 commit
# 179,467
Jupyter...
pandas
python3
volatil...
1 commit
# 269,211
Python
Jupyter...
pandas
python3
1 commit

CircleCI Documentation Status Coverage Status Code style: black Linter: Prospector PyPI PyPI - Downloads Donate PayPal

Technical Analysis Library in Python

It is a Technical Analysis library useful to do feature engineering from financial time series datasets (Open, Close, High, Low, Volume). It is built on Pandas and Numpy.

Bollinger Bands graph example

The library has implemented 42 indicators:

Volume

  • Money Flow Index (MFI)
  • Accumulation/Distribution Index (ADI)
  • On-Balance Volume (OBV)
  • Chaikin Money Flow (CMF)
  • Force Index (FI)
  • Ease of Movement (EoM, EMV)
  • Volume-price Trend (VPT)
  • Negative Volume Index (NVI)
  • Volume Weighted Average Price (VWAP)

Volatility

  • Average True Range (ATR)
  • Bollinger Bands (BB)
  • Keltner Channel (KC)
  • Donchian Channel (DC)
  • Ulcer Index (UI)

Trend

  • Simple Moving Average (SMA)
  • Exponential Moving Average (EMA)
  • Weighted Moving Average (WMA)
  • Moving Average Convergence Divergence (MACD)
  • Average Directional Movement Index (ADX)
  • Vortex Indicator (VI)
  • Trix (TRIX)
  • Mass Index (MI)
  • Commodity Channel Index (CCI)
  • Detrended Price Oscillator (DPO)
  • KST Oscillator (KST)
  • Ichimoku Kinkō Hyō (Ichimoku)
  • Parabolic Stop And Reverse (Parabolic SAR)
  • Schaff Trend Cycle (STC)

Momentum

  • Relative Strength Index (RSI)
  • Stochastic RSI (SRSI)
  • True strength index (TSI)
  • Ultimate Oscillator (UO)
  • Stochastic Oscillator (SR)
  • Williams %R (WR)
  • Awesome Oscillator (AO)
  • Kaufman's Adaptive Moving Average (KAMA)
  • Rate of Change (ROC)
  • Percentage Price Oscillator (PPO)
  • Percentage Volume Oscillator (PVO)

Others

  • Daily Return (DR)
  • Daily Log Return (DLR)
  • Cumulative Return (CR)

Documentation

https://technical-analysis-library-in-python.readthedocs.io/en/latest/

Motivation to use

How to use (Python 3)

$ pip install --upgrade ta

To use this library you should have a financial time series dataset including

Timestamp
,
Open
,
High
,
Low
,
Close
and
Volume
columns.

You should clean or fill NaN values in your dataset before add technical analysis features.

You can get code examples in examplestouse folder.

You can visualize the features in this notebook.

Example adding all features

import pandas as pd
from ta import add_all_ta_features
from ta.utils import dropna


Load datas

df = pd.read_csv('ta/tests/data/datas.csv', sep=',')

Clean NaN values

df = dropna(df)

Add all ta features

df = add_all_ta_features( df, open="Open", high="High", low="Low", close="Close", volume="Volume_BTC")

Example adding particular feature

import pandas as pd
from ta.utils import dropna
from ta.volatility import BollingerBands


Load datas

df = pd.read_csv('ta/tests/data/datas.csv', sep=',')

Clean NaN values

df = dropna(df)

Initialize Bollinger Bands Indicator

indicator_bb = BollingerBands(close=df["Close"], window=20, window_dev=2)

Add Bollinger Bands features

df['bb_bbm'] = indicator_bb.bollinger_mavg() df['bb_bbh'] = indicator_bb.bollinger_hband() df['bb_bbl'] = indicator_bb.bollinger_lband()

Add Bollinger Band high indicator

df['bb_bbhi'] = indicator_bb.bollinger_hband_indicator()

Add Bollinger Band low indicator

df['bb_bbli'] = indicator_bb.bollinger_lband_indicator()

Add Width Size Bollinger Bands

df['bb_bbw'] = indicator_bb.bollinger_wband()

Add Percentage Bollinger Bands

df['bb_bbp'] = indicator_bb.bollinger_pband()

Deploy and develop (for developers)

$ git clone https://github.com/bukosabino/ta.git
$ cd ta
$ pip install -r requirements-play.txt
$ make test

Sponsor

Logo OpenSistemas

Thank you to OpenSistemas! It is because of your contribution that I am able to continue the development of this open source library.

Based on

  • https://en.wikipedia.org/wiki/Technical_analysis
  • https://pandas.pydata.org
  • https://github.com/FreddieWitherden/ta
  • https://github.com/femtotrader/pandas_talib

In Progress

  • Automated tests for all the indicators.

TODO

Changelog

Check the changelog of project.

Donation

If you think

ta
library help you, please consider buying me a coffee.

Credits

Developed by Darío López Padial (aka Bukosabino) and other contributors.

Please, let me know about any comment or feedback.

Also, I am a software engineer freelance focused on Data Science using Python tools such as Pandas, Scikit-Learn, Backtrader, Zipline or Catalyst. Don't hesitate to contact me if you need to develop something related with this library, Python, Technical Analysis, AlgoTrading, Machine Learning, etc.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.