https://github.com/bukosabino/ta
Raw File
Tip revision: a7d77622177d722e2c71de5773f188ac7fd94e6e authored by Bukosabino on 06 September 2018, 14:10:43 UTC
new indicator (aroon): https://github.com/bukosabino/ta/pull/17
Tip revision: a7d7762
bollinger_band_features_example.py
"""This is a example adding bollinger band features.
"""
import pandas as pd
from ta import *

# Load data
df = pd.read_csv('../data/datas.csv', sep=',')

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

print(df.columns)

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

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

print(df.columns)
back to top