All indicators

ATR Bands

Apr 28, 2022

Static chart image
Dynamic OverlaysChannelsDashboardVolatility

The ATR Bands indicator provides dynamic price channels based on the Average True Range to assist traders in identifying potential stop-loss levels and take-profit targets.

Usage

The Usage section describes how the script can be used to manage trade exits and identify consolidation zones. By default, the indicator plots two bands (upper and lower) based on a multiplier of the ATR. Traders often use the lower band for long stop-losses and the upper band for short stop-losses.

Examples of usage include:

  • Stop-Loss Identification: Using the "ATR Band Scale Factor" to create a buffer around price action to avoid premature stop-outs during high volatility.
  • Take-Profit Targets: Enabling the "Show opposite bands for take-profit zones" to project potential targets based on a reward-to-risk ratio relative to the stop-loss bands.
  • Consolidation Breakouts: Observing price when it levels out; a "consolidation zone" can be identified between the first peak of the upper band and the first valley of the lower band. A candle close outside this zone often indicates a notable move in that direction.
  • Data Monitoring: Using the on-chart dashboard to view real-time distance in ticks or pips to the designated stop and target levels.

Details

The script calculates the Average True Range (ATR) over a user-defined period and multiplies it by a scaling factor. Unlike standard implementations that may fix the calculation source to high or low prices, this script uses the closing price to ensure more consistent band placement.

Take-profit bands are calculated by projecting the distance between the close and the stop-loss band in the opposite direction, adjusted by a secondary "Take-Profit Scale Factor." This allows for a systematic approach to maintaining specific reward-to-risk ratios (e.g., 1.5:1). The indicator is refactored for modern Pine Script performance and supports non-chart timeframe usage for multi-timeframe analysis.

Settings

ATR Bands Standard Settings

  • ATR Period: The lookback period used for the ATR calculation. Lower values are more reactive, while higher values smooth the bands for long-term trends.
  • ATR Band Scale Factor: The multiplier applied to the ATR value to determine the distance of the bands from the price.

Take-Profit Settings

  • Show opposite bands for take-profit zones: Toggles the visibility of secondary bands used for profit targets.
  • Take-Profit Scale Factor: A multiplier used to define the reward/risk ratio for the take-profit bands relative to the stop-loss bands.

Table Settings

  • Show Table for Stops and Targets: Enables an on-chart dashboard displaying exact price levels for stops and targets.
  • Allow Table Repainting: When enabled, the table updates in real-time with the current candle's price rather than waiting for the close.
  • Include additional rows/columns to display take-profit values: Adds profit target data to the dashboard.
  • Align Table Vertically: Switches the table orientation between horizontal and vertical.
  • Table Location: Determines the corner or side of the chart where the dashboard is anchored.
  • Table Colors: Customization options for the background and border colors of the dashboard elements.

FAQ

How do I adjust the sensitivity of the bands?
You can adjust sensitivity by changing the "ATR Period" (for speed) or the "ATR Band Scale Factor" (for distance/width).

Can I use this for multi-timeframe analysis?
Yes, the script is designed to support alternate timeframe usage through standard platform settings, allowing you to view higher-timeframe ATR levels on a lower-timeframe chart.

How do I access the ATR Bands 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.