How to calculate Bollinger Bands With Live Data


Hey guys, hoping anyone with general knowledge of bollinger bands and python can help me with this issue. I am creating a program that attempts to mirror the bollinger bands that are calculated by Interactive Brokers. I get live data straight from IBKR and it comes in the form of 5 second “bars” with close, open, high, and low attributes. My current strategy when it comes to mirroring these bollinger bands is every minute appending the last close price to a list and calculating the bb bands from there. This price list is duplicated every 10 seconds and the most recent close price is appended to it, allowing the bb bands to be updated in an attempt to match IBKR's seemingly random re-calculation strategy looking at the live chart. This works in practice but the values outputted by my program are usually inconsistent by a few cents every time. Sometimes it works but most of the time its a little bit off. I guess a more general question would be how often do you think IBKR updates their indicators on a tick by tick level? I would appreciate any help as this bug sucks. Thanks!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *