Skip to main content

Bollinger Bands in the Trade Rule Block

Bollinger Bands measure volatility with three lines; use them to spot breakouts, overbought/oversold zones, and dynamic support/resistance.

Updated over 4 months ago

Purpose of Bollinger Bands

Bollinger Bands are a volatility-based indicator that consists of three lines — a middle band (usually a moving average) and two outer bands placed above and below it. In the Trade Rule block, you can use Bollinger Bands to measure price volatility, identify potential overbought/oversold conditions, or trigger trades when price interacts with a specific band.


How It Works

When you select Bollinger Bands as a value type in the Trade Rule block, you can customize several parameters to fine-tune the indicator for your strategy:

Bands Period of Bollinger Bands

  • The number of candles used to calculate the middle line (moving average).

  • Example: A period of 20 uses the last 20 candles in the calculation.

Bands Mode of Bollinger Bands (Which band to use)

  • Middle Line: The central moving average line.

  • Upper Line: Middle line + (Deviation × standard deviation of price).

  • Lower Line: Middle line – (Deviation × standard deviation of price).

Bands Shift of Bollinger Bands (Advanced Option)

  • Moves the entire indicator forward or backward on the chart by a set number of candles.

  • Mainly used for testing or offset strategies.

Deviation of Bollinger Bands

  • Controls the distance of the upper and lower bands from the middle band.

  • Higher deviation = wider bands (more volatility buffer).

  • Lower deviation = narrower bands (more sensitivity to price).

Applied Price of Bollinger Bands (What the bands are calculated from)

  • Close Price: Uses the candle’s closing price.

  • Open Price: Uses the candle’s opening price.

  • High Price: Uses the highest price in the candle.

  • Low Price: Uses the lowest price in the candle.

  • Median Price: (High + Low) ÷ 2

  • Typical Price: (High + Low + Close) ÷ 3

  • Weighted Price: (High + Low + Open + Close) ÷ 4

Time Frame of Bollinger Bands

  • Sets the chart time frame for the Bollinger Bands calculation.

  • Can be replaced with a variable or input for quick testing and optimization.

Candle ID of Bollinger Bands

  • Defines which candle the calculation starts from.

  • 0: Current candle (still forming).

  • 1: Most recently closed candle.

  • Higher IDs refer to older candles.

Adjust of Bollinger Bands (Modify the Result)

  • Apply an adjustment to the calculated value by adding, subtracting, multiplying, or dividing by a number.


Example

If you set:

  • Bands Period: 20

  • Bands Mode: Upper Line

  • Deviation: 2

  • Applied Price: Close

  • Candle ID: 1
    The block will return the value of the upper band of a 20-period Bollinger Band, calculated from the closing price of the most recently closed candle.


Use Cases

  • Detect overbought conditions when price touches the upper band.

  • Detect oversold conditions when price touches the lower band.

  • Use the middle line as a dynamic support/resistance level.

  • Identify volatility squeezes when the bands narrow, potentially signaling an upcoming breakout.


Tip: Combining Bollinger Bands with other indicators (e.g., Moving Average, RSI) can help filter false signals and improve strategy accuracy.

Did this answer your question?