Zipline.pipeline.factors Parameters and Output

In the Usage Guide and API reference for Zipline.pipeline.factors I don't see reference to some Parameters I would have expected.

For example, with BollingerBands I see the lookback window and standard deviation but I don't see reference to the Upper and Lower Bands other than the documentation saying the two parameters are used to create the bands. If I wanted to reference them as overbought or oversold levels do I need to define the Upper and Lower Bands myself or can they be called?

Is there another source I can reference to understand the output of all the Zipline.pipeline.factors so I know what can be called and what I need to define on my own?

Thank you.

The docstrings could be improved for multi-output factors. Multi-output factors have an outputs attribute containing the names of the available outputs. Here is a better example of how to use BollingerBands:

In [1]: from zipline.pipeline.factors import BollingerBands
In [2]: from zipline.pipeline import EquityPricing

In [3]: bbands = BollingerBands(window_length=14, k=2)

In [4]: # See names of available outputs
In [5]: bbands.outputs
Out[5]: ('lower', 'middle', 'upper')

In [6]: overbought = EquityPricing.close.latest > bbands.upper
1 Like

Very helpful. Thank you Brian.