ATR % V3Now I'll provide you with the fully translated script and comprehensive documentation:
ATR % V3 Indicator - Introduction
The ATR % V3 is a Pine Script indicator that displays the Average True Range (ATR) as a percentage of price, providing traders with a normalized view of market volatility. Unlike the standard ATR which shows absolute price values, this percentage-based approach allows for easier comparison across different securities and timeframes. The indicator includes advanced features such as multi-day extreme value detection, customizable horizontal reference lines, and optional coordinate inversion for specialized charting needs.
Key Features
Percentage-based ATR calculation relative to either current open or previous close
Flexible smoothing methods (RMA, SMA, EMA, WMA) for different trading styles
Multi-period extreme value markers for 3-day and 7-day highs/lows
Dynamic horizontal reference line showing current ATR% value
Optional coordinate flip for alternative visualization perspectives
Bar confirmation control to prevent repainting on live bars
Technical Explanation
ATR Percentage Calculation
The script calculates ATR% using the formula: ATR% = (ATR / Basis Price) × 100. The basis price can be either the current bar's open price or the previous bar's close price, allowing traders to choose the reference point that best suits their trading methodology.
Smoothing Methods
The indicator supports four moving average types for ATR smoothing:
RMA (Relative Moving Average): Default method, provides exponentially smoothed values similar to Wilder's original ATR implementation
SMA (Simple Moving Average): Equal weighting of all periods
EMA (Exponential Moving Average): Recent prices weighted more heavily
WMA (Weighted Moving Average): Linear weighting scheme
Extreme Value Detection
The script identifies when the current ATR% value represents a local extreme over 3-day or 7-day lookback periods. These markers appear only on the most recent bar and help traders identify volatility compression or expansion zones that may precede significant price moves.
Anti-Repainting Feature
The "Wait for Bar Close to Update" option prevents the indicator from recalculating on every tick within an unconfirmed bar. When enabled, the ATR% value updates only after each bar closes, ensuring consistent historical values that won't change retroactively.
Usage Recommendations
For Volatility Analysis: Use the percentage-based approach to compare volatility across different assets or timeframes objectively. Higher ATR% values indicate increased volatility relative to price.
For Position Sizing: ATR% can inform position size adjustments—reduce exposure when volatility (ATR%) spikes, and potentially increase when volatility contracts.
For Stop Loss Placement: The horizontal reference line provides a quick visual reference for current volatility levels, useful for setting volatility-adjusted stop losses.
For Breakout Confirmation: Watch for 3-day or 7-day extreme markers—volatility extremes often precede or confirm trend reversals or breakouts.
Pine Script® indicator






















