bukosabino / ta

Technical Analysis Library using Pandas and Numpy

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bollinger Band data series - something is off

szayedoud opened this issue · comments

Hi -

I am using ib_insync with ta, and I reinstantiate my BollingerBand object after each new bar, with the last 20 bars (maybe that's the problem). BollingerBands(close=self.bars["close"], window=20, window_dev=2, fillna=True)

  • When I look at what I get back from bollinger_wband() method, only the last width is accurate, the other values preceding it are all wrong

  • Using the bollinger_hband() - I only get a value on the last series (most recent) and NaN for the previous 19

Any ideas on these 2 issues? I apologize in advance if I'm not using the API properly. Is there a more event driven way, where I only have to instantiate it once, and each bar is updated on current instance of the indicator ?

The dataset needs to exceeed the window size to get proper calculations.