Welcome to Technical Analysis Library in Python’s documentation!

It is a Technical Analysis library to financial time series datasets (open, close, high, low, volume). You can use it to do feature engineering from financial datasets. It is builded on Python Pandas library.

Installation (python >= v3.6)

> virtualenv -p python3 virtualenvironment
> source virtualenvironment/bin/activate
> pip install ta

Examples

Adding all features:

import pandas as pd
import ta

# Load datas
df = pd.read_csv('your-file.csv', sep=',')

# Clean nan values
df = ta.utils.dropna(df)

# Add ta features filling Nans values
df = ta.add_all_ta_features(df=df, open="Open", high="High", low="Low", close="Close", volume="Volume_BTC", fillna=True)

Adding individual features:

import pandas as pd
import ta

# Load datas
df = pd.read_csv('your-file.csv', sep=',')

# Clean nan values
df = ta.utils.dropna(df)

# Add bollinger band high indicator filling Nans values
df['bb_high_indicator'] = ta.volatility.bollinger_hband_indicator(df["Close"], n=20, ndev=2, fillna=True)

# Add bollinger band low indicator filling Nans values
df['bb_low_indicator'] = ta.volatility.bollinger_lband_indicator(df["Close"], n=20, ndev=2, fillna=True)

Indices and tables