Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Bollinger Bands factor?

I am trying to use Bollinger Bands as a factor in my pipeline. It's a built-in factor, but not much is said about it in the docs, or any of the factors really, just that it exists and it has some paramaters that are such and such. I have to know what kind of data it returns. I know what Bollinger Bands are, but I can't understand how it could return data to put into a single pipline column. Could someone let me know how quantopian implements Bollinger Bands as a factor? I specifically want to use it to find breakouts.

1 response

You can use it like below to have the bands in your pipeline output:

# k : float:    The number of standard deviations to add or subtract to create the  
# upper and lower bands.

lower, middle, upper = BollingerBands(mask=my_universe, window_length=22, k=1.)  
pipe.add(lower, 'lower')  
pipe.add(middle, 'middle')  
pipe.add(upper, 'upper')