I am trying to plot a price curve with Bollinger Bands. Using the sample code from Zorro help seems to work. However, there are periods when all three bands unite. For instance using price data from 12/2/2013 between 5am and 7am (but one can find this in any others day data). How come?
The Bollinger Bands function is not from Zorro, but from the TA-Lib, so I can't say why it unites. Maybe this happens due to gaps in the data. 1-minute data are very likely to have gaps. We'll look into that, maybe we can automatically fill the gaps for working around such cases.
Re: Bollinger Bands: upper and lower band unite with middle band
[Re: jcl]
#441242 05/16/1410:3505/16/1410:35
Ok, I was informed that the reason was _not_ gaps in the data, but a lower limit to the standard deviation function in the TA-Lib. If the StdDev is below 0.0001, it's assumed to be zero. Therefore you'll get bands with zero width.
As a simple workaround, just multiply the data with 10 for preventing that the StdDev gets below 0.0001:
This isn't mentionned in the manual, and unlike the SAR, a corrected lite-c version hasn't been made.
Why?
I can understand not wanting to replace the current function because it might throw off some existing strategies, but at the very least this should be mentioned in the Remarks section of the manual page on indicators.
Re: Bollinger Bands: upper and lower band unite with middle band
[Re: jcl]
#468136 09/19/1717:0409/19/1717:04