BB (Bollinger Bands)
Bollinger Bands (BB) are a volatility indicator composed of three lines. The middle band is a simple moving average (SMA), and the upper and lower bands are typically two standard deviations above and below the SMA. The bands widen when volatility increases and narrow when volatility decreases. Bollinger Bands are used to identify overbought and oversold levels, and to spot potential breakouts.
Arguments
| Name | Description |
|---|---|
period | number of candles |
multiplier | multiplier |
type | one of avg, up or low |
Useful Signal Expressions
1. Breakout Above Upper Band
Signal:
close().crosses_above(close().bb(20, 2, up))
Explanation: The price crosses above the upper Bollinger Band, which could indicate a breakout.
2. Breakdown Below Lower Band
Signal:
close().crosses_below(close().bb(20, 2, low))
Explanation: The price crosses below the lower Bollinger Band, which could indicate a breakdown.
3. Bollinger Band Squeeze
Signal:
close().bb(20, 2, up).sub(close().bb(20, 2, low)).falling(10)
Explanation: The width of the Bollinger Bands is decreasing for 10 periods, which is known as a "squeeze". This often precedes a significant price move.
