Open pedrovgp opened 4 years ago
Hi @pedrovgp ,
Thank you for your question.
Well, to be honest, I started to develop this library two years ago as a way to learn about Pandas and Numpy tools. I didn't find any pure Python library to do technical analysis on financial datasets, so I created this one. It was just a "game". Over time, the financial community starts to use more and more Python packages. So, during this time, I have worked building this useful tool for them. I will try to explore the advantages and disadvantages of the use of this library:
Advantages for ta
ta
is a light-weight library written in pure Python language, and ta-lib
is a wrapper over C language.
ta-lib
has several issues to be installed sometimes.
Most of the indicators provide you with not only the standard values but also when those are crossed. For example, we can pick the Bollinger Bands API for these two libraries:
ta-lib
from talib import MA_Type
upper, middle, lower = talib.BBANDS(close, matype=MA_Type.T3)
ta
from ta.volatility import BollingerBands
# Initialize Bollinger Bands Indicator
indicator_bb = BollingerBands(close=df["Close"], n=20, ndev=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()
Advantages for ta-lib
ta-lib
has implemented more indicators than ta
It is a personal vision. Probably, the community can provide us with more views about this question.
Best, Dario
What are the advantages and disadvantages of this library compared to https://ta-lib.org