Bollinger Bands %B
Bollinger Bands %B (Percent Bandwidth) tells you where the current price sits relative to the Bollinger Bands. It converts the position between the upper and lower bands into a value between 0 and 1 — making it easy to set precise signal thresholds.
How it works: The Bollinger Bands are calculated using a Simple Moving Average (middle band) with upper and lower bands placed at a specified number of standard deviations above and below. %B = (Price - Lower Band) / (Upper Band - Lower Band).
Settings in block algo flex
| Setting | Description | Default |
|---|---|---|
| Use Bollinger Bands %B? | Enable/disable the indicator | Off |
| InpBB_length | Number of periods for the SMA and standard deviation | 20 |
| Source | Price component for calculation | close |
| StdDev | Number of standard deviations for band width | 2 |
| Timeframe | Timeframe for calculation | Chart |
| Buy Condition | Triggers buy when %B meets this condition (e.g., "Less Than 0") | Less Than 0 |
| Sell Condition | Triggers sell when %B meets this condition (e.g., "Greater Than 1") | Greater Than 1 |
How to Interpret
- %B > 1 — Price is above the upper band (potential overbought / breakout)
- %B < 0 — Price is below the lower band (potential oversold / breakdown)
- %B = 0.5 — Price is at the middle band (SMA)
Pro Tip: Bollinger Bands %B works best for mean-reversion strategies. Combine it with a trend filter like ADX or EMA Price to avoid trading against strong trends where price can stay outside the bands for extended periods.