ATR Structure Trail Pro & Range Filter (v6)
Feb 6, 2026

The ATR Structure Trail Pro & Range Filter (v6) indicator is a multi-purpose trend-following and consolidation detection tool designed to identify structural market shifts and volatility-based trend directions. It streamlines price action analysis by combining pivot-based structure flips with a dynamic trailing stop and automated range detection.
Usage
The Usage section describes how the script can be used to interpret market context. It is primarily used to distinguish between trending environments and consolidation phases.
- Trend Direction: Use the ATR trailing line to determine the current market bias. A green line indicates a bullish trend, while a red line indicates a bearish trend.
- Structural Flips: Look for the green and red arrows which highlight shifts in market structure (e.g., Higher Highs or Lower Lows). These serve as visual markers for potential trend reversals or continuations.
- Range Filtering: The indicator automatically draws boxes when it detects tight consolidation. Blue or purple boxes signify "no-trade" zones where price action is sideways, helping users avoid choppy market conditions.
- HTF Alignment: By utilizing the "Signal Timeframe" setting, users can project Higher Timeframe (HTF) trends and structure onto their current chart for multi-timeframe alignment.
Details
The script operates using three core logic components:
- Pivot Detection: It monitors Pivot Highs and Pivot Lows over a user-defined length. A "flip" occurs when price closes above a previous pivot high or below a previous pivot low.
- Volatility Trailing: The trailing stop is calculated using the Average True Range (ATR). It remains below price during uptrends and above price during downtrends, only flipping when price closes on the opposite side.
- Range Calculation: Consolidation is identified by comparing the recent price range (High to Low over a specific period) against a multiple of the ATR. If the range is narrower than the volatility-adjusted threshold, a consolidation box is initiated.
Settings
ATR Settings
- ATR Length: Sets the lookback period for the Average True Range calculation.
- ATR Multiplier (Trail): Determines the distance of the trailing stop from the price.
Structure & Logic
- Structure Pivot Len: The number of bars required on either side to confirm a pivot point.
- Signals After Bar Close: When enabled, signals are only confirmed once the candle closes to prevent intrabar repainting.
- Signal Timeframe (HTF): Allows the user to select a different timeframe for the calculations.
Range Detection
- Top Range Detect Bars: The lookback window used to calculate the recent high-low range for consolidation detection.
- Range Width (<= xATR): The threshold multiplier; if the range is tighter than this value times ATR, a range box appears.
Visuals
- Show Trade Boxes: Toggles the visibility of expansion/trend boxes.
- Show RANGE Box: Toggles the visibility of consolidation boxes.
- Colors/Transparency: Various settings to customize the appearance of the trail line, box fills, and borders.
FAQ
How do I interpret the colored arrows? The arrows represent structural flips based on pivot points. A green arrow indicates a break of a previous high, while a red arrow indicates a break of a previous low, signaling a shift in market context.
What does it mean when a blue or purple box appears? These boxes indicate that the market has entered a range-bound or consolidation phase based on volatility. Traders often use these to avoid entering new positions until a breakout occurs.
How can 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.