All indicators

[KL] Bollinger Bands Consolidation Strategy

Apr 20, 2021

Static chart image
Price Action BasedSignalsOscillatorsCandlestickMoving AveragesTrailing-StopVolatility

The [KL] Bollinger Bands Consolidation Strategy indicator is a technical tool designed to identify and trade periods of low volatility and price consolidation using a combination of Bollinger Bands and Average True Range (ATR). It aims to capture potential breakout opportunities by entering long positions when the market exhibits specific "squeeze" characteristics followed by trend confirmation.

Usage

The Usage section describes how the script can be used to identify market consolidation and manage trade exits.

  • Identifying Consolidation: The strategy triggers a "squeeze" signal when the distance between the Bollinger Band center line and the outer bands is less than two current ATRs. This visually represents narrowing volatility.
  • Entry Confirmation: A long entry is initiated during a squeeze if secondary conditions are met, such as a green candle or Doji, an upward-trending 20-period EMA, and a non-increasing ATR (suggesting stable or decreasing volatility).
  • Trailing Stop Loss: The indicator features a dynamic trailing stop loss based on a 2x ATR multiplier. Users can choose the source for the stop loss calculation (Close, Low, or the average of both).
  • Exit Conditions: The strategy can exit based on a fixed reward-to-risk ratio, bearish price action, or overbought RSI conditions.

Details

The strategy relies on the principle that periods of low volatility often precede significant price movements.

  • Bollinger Bands (BOLL): Uses a standard 20-period Simple Moving Average (SMA) with 2 standard deviations. Narrowing bands serve as the primary filter for consolidation.
  • ATR Confirmations: The script compares the Bollinger Band standard deviation against the ATR. If the 2x ATR value is greater than the 2x Standard Deviation value, the bands are considered to be "squeezing."
  • Volatility Filtering: By monitoring the moving average of the ATR, the strategy ensures that the market is truly consolidating rather than experiencing choppy, erratic behavior.

Settings

  • Backtest Start/End Time: Defines the specific window for historical performance analysis.
  • No. of candles to lookback when determining ATR is decreasing: Sets the period used to compare the current Average True Range against previous values.
  • Update the size of stoploss after entry: If enabled, the stop loss distance will recalculate based on updated ATR values during a trade.
  • Source of TSL: Determines if the trailing stop loss follows the Close, Low, or the midpoint of both.
  • Reward ratio for exit: Sets the target profit level relative to the initial risk.
  • Ignore sell signals during consolidation: Prevents the strategy from exiting trades while the Bollinger Band squeeze is still active.
  • Exit position when overbought: Enables exits based on RSI thresholds (RSI 14 > 70 and RSI 10 > RSI 14).
  • Tighten TSL instead of exiting when candle is bearish: A defensive setting that moves the stop loss closer rather than closing the position immediately upon seeing a bearish candle.

FAQ

  • How does the squeeze logic work? The squeeze is identified when the volatility measured by the standard deviation (Bollinger Bands) falls below the volatility measured by the ATR, signifying a contraction in price range.
  • Can I use this for short positions? In its current implementation, this specific script is optimized for long-entry consolidation breakouts.
  • How do I access this indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.