All indicators

ATR Trailing Stops S/R

Oct 1, 2021

Static chart image
Support and ResistanceSignalsTrailing-StopVolatilityRepainting Functionality

The ATR Trailing Stops S/R indicator identifies significant support and resistance levels by tracking stable periods within an Average True Range (ATR) trailing stop line to highlight potential price bounce zones.

Usage

The Usage section describes how the script can be used to identify key market structures. The tool plots a trailing stop based on volatility; when this stop remains flat for a specific duration, it suggests a level where price has established a temporary ceiling or floor. These "plateaus" are automatically converted into horizontal Support and Resistance (S/R) lines.

  • Identifying Bounces: Traders can use the extended horizontal lines as potential areas for price reversals or profit-taking.
  • Trend Following: The color-coded trailing stop line (Bullish vs. Bearish) indicates the current trend direction. A crossover above the line suggests a bullish shift, while a crossunder suggests a bearish shift.
  • Multi-Timeframe Analysis: By adjusting the Resolution setting, users can project higher timeframe S/R levels onto their current chart to find confluence.

Details

The script is based on an ATR trailing stop logic originally developed by dgmoon. The core mechanism calculates a volatility-adjusted stop-loss level that follows price action. Unlike a standard trailing stop, this script monitors the consistency of the stop value.

If the stop value remains unchanged for a user-defined number of candles (Candle Count), the script interprets this as a significant price level and renders a horizontal S/R line. The script uses an internal array system to manage these lines, allowing users to control how many historical levels remain on the chart simultaneously.

Settings

  • Safety Settings:
    • Allow Repainting: Determines if the script uses real-time security data or historical offsets to prevent repainting.
    • Allow Bar Color Change: Enables the script to color the chart candles based on the current bullish or bearish trend.
  • Main Time Frame Settings:
    • 1st Resolution: Sets the timeframe from which the ATR and price data are derived.
    • ATR Period: The lookback period used to calculate market volatility.
    • ATR Multiplier: The factor applied to the ATR to determine the distance of the trailing stop from price.
    • Show S/R: Toggles the display of the horizontal support and resistance lines.
    • Extend S/R: If enabled, the S/R lines will extend toward the right of the chart until they are broken by price.
    • Line Count: Limits the maximum number of historical S/R lines displayed on the chart.
    • Candle Count: Specifies the minimum number of bars the trailing stop must stay at the same level before an S/R line is generated.
    • Bull/Bear Colors: Customizes the visual output for bullish and bearish trends.

FAQ

How does the indicator determine a support or resistance level? The indicator looks for periods where the ATR Trailing Stop remains at a constant price level for a specific number of bars, indicating a consolidated zone of volatility-adjusted support or resistance.

Can I use this for day trading? Yes, the indicator is versatile and can be used on any timeframe by adjusting the ATR settings and the Resolution parameter to suit intraday volatility.

How do I get access to the ATR Trailing Stops S/R? 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.