Recent from talks
Nothing was collected or created yet.
Average true range
View on WikipediaAverage true range (ATR) is a technical analysis volatility indicator originally developed by J. Welles Wilder, Jr. for commodities.[1][2] The indicator does not provide an indication of price trend, simply the degree of price volatility.[3] The average true range is an N-period smoothed moving average (SMMA) of the true range values. Wilder recommended a 14-period smoothing.[4]
Calculation
[edit]
The range of a day's trading is simply . The true range extends it to yesterday's closing price if it was outside of today's range.
The true range is the largest of the:
- Most recent period's high minus the most recent period's low
- Absolute value of the most recent period's high minus the previous close
- Absolute value of the most recent period's low minus the previous close
The formula can be simplified to:
The ATR at the moment of time t is calculated using the following formula: (This is one form of an exponential moving average)
The first ATR value is calculated using the arithmetic mean formula:
N.B. This first value is the first in the time series (not the most recent) and is n periods from the beginning of the chart.
The idea of ranges is that they show the commitment or enthusiasm of traders. Large or increasing ranges suggest traders prepared to continue to bid up or sell down a stock through the course of the day. Decreasing range suggests waning interest.
Applicability to futures contracts vs. stocks
[edit]Since true range and ATR are calculated by subtracting prices, the volatility they compute does not change when historical prices are back-adjusted by adding or subtracting a constant to every price. Back-adjustments are often employed when splicing together individual monthly futures contracts to form a continuous futures contract spanning a long period of time. However the standard procedures used to compute volatility of stock prices, such as the standard deviation of logarithmic price ratios, are not invariant (to addition of a constant). Thus futures traders and analysts typically use one method (ATR) to calculate volatility, while stock traders and analysts typically use standard deviation of log price ratios.
Use in position size calculation
[edit]Apart from being a trend strength gauge, ATR serves as an element of position sizing in financial trading. Current ATR value (or a multiple of it) can be used as the size of the potential adverse movement (stop-loss distance) when calculating the trade volume based on trader's risk tolerance. In this case, ATR provides a self-adjusting risk limit dependent on the market volatility for strategies without a fixed stop-loss placement.[citation needed]
References
[edit]- ^ J. Welles Wilder, Jr. (June 1978). New Concepts in Technical Trading Systems. Greensboro, NC: Trend Research. ISBN 978-0-89459-027-6.
- ^ "Average True Range (ATR) [ChartSchool]". school.stockcharts.com. Retrieved 2024-03-17.
- ^ Joel G. Siegel (2000). International encyclopedia of technical analysis. Global Professional Publishing. p. 341. ISBN 978-1-888998-88-7.
- ^ This is by his reckoning of SMMA periods, meaning an α=1/14.
Average true range
View on GrokipediaOverview and History
Definition and Purpose
The Average True Range (ATR) is a technical indicator designed to measure market volatility by calculating the average of the true range values over a specified period, most commonly 14 days.[3] It provides an objective assessment of the extent of price fluctuations in a financial instrument, capturing the full scope of daily price movements without regard to their directional bias.[4] The true range serves as the foundational daily measure for this calculation, incorporating the high-low range alongside any gaps from the previous close.[5] The primary purpose of the ATR is to assist traders in evaluating the magnitude of price movements, enabling them to adapt trading strategies to prevailing market conditions and manage associated risks more effectively.[6] By focusing solely on volatility rather than predicting price direction, it helps in setting realistic expectations for potential price swings and in calibrating position sizes or stop-loss levels accordingly.[1] In financial markets, volatility refers to the degree of variation in trading prices over time, often manifesting as rapid or erratic changes that can amplify both opportunities and risks.[3] The ATR quantifies this volatility in absolute price units, such as dollars for stocks or points for indices, offering a practical metric that scales with the asset's price level.[7] This indicator was introduced by J. Welles Wilder in his 1978 book New Concepts in Technical Trading Systems, where it was presented as a tool for commodity trading but has since become widely applicable across various asset classes.[8]Development by J. Welles Wilder
J. Welles Wilder Jr., an American mechanical engineer who transitioned into trading and real estate development, created the Average True Range (ATR) indicator during the 1970s as a means to quantify market volatility more effectively.[9] Born in 1935 and passing away in 2021, Wilder applied his engineering background to financial markets, seeking to develop tools that addressed practical challenges in trading commodities, where price gaps and erratic movements were prevalent.[9] The ATR was first introduced in Wilder's seminal 1978 book, New Concepts in Technical Trading Systems, where it appeared alongside other influential indicators such as the Relative Strength Index (RSI) and Parabolic SAR.[8] Wilder's primary motivation was to overcome the shortcomings of traditional range measurements, which often failed to capture true price volatility in futures and commodities markets due to overnight gaps and non-continuous trading.[8] By focusing on the "true range"—the greatest of the current high-low difference, the absolute value of the high minus the previous close, or the absolute value of the low minus the previous close—Wilder aimed to provide traders with a robust, gap-inclusive metric for assessing market dynamism.[10] Since its inception, the ATR has seen widespread adoption in contemporary trading platforms, including MetaTrader 4 and 5, where it is integrated as a standard volatility tool, and TradingView, which supports customizable implementations for real-time analysis.[10][4] While practitioners have experimented with variations in the smoothing period—such as the original 14 periods versus 20 for longer-term assessments based on backtesting results—the core methodology has remained unaltered since 1978.[8] Wilder's broader contributions emphasized the creation of practical, responsive indicators that minimize lag, enabling more effective trend-following strategies in volatile environments.[9]Calculation Methods
True Range Components
The true range (TR) serves as the foundational component for calculating the average true range (ATR), representing the maximum price movement over a single trading period, such as a day. It is defined as the greatest of three possible values: the difference between the current period's high and low prices, the absolute value of the current high minus the previous period's closing price, or the absolute value of the current low minus the previous period's closing price.[8][2] This definition, introduced by J. Welles Wilder Jr. in his 1978 book New Concepts in Technical Trading Systems, assumes familiarity with basic candlestick chart elements like high (H), low (L), and close (C).[8] The mathematical formula for true range is: where is the current high, is the current low, and is the previous close.[8][2] The use of the maximum function ensures that TR captures the largest extent of price variation, while absolute values prevent negative results from directional differences.[2] This formulation accounts for overnight or inter-period gaps in pricing, which are common in non-24-hour markets like stocks and commodities, where trading halts can lead to opening prices significantly different from the prior close.[8][2] By incorporating the gaps via and , TR provides a more complete measure of volatility than a simple high-low range, which might understate movement if a gap exceeds intraday fluctuations.[2] For instance, consider a stock that closes at $50 on day 1. On day 2, it gaps down to open at $48, reaching a high of $49 and a low of $47. The high-low range is $49 - $47 = $2|H - C_{\text{prev}}| = |49 - 50| = $1|L - C_{\text{prev}}| = |47 - 50| = $3. Thus, TR = max[$2, $1, $3] = $3, reflecting the full gap-influenced volatility beyond the intraday range.[8]Computing the Average True Range
The Average True Range (ATR) is computed as an exponential moving average (EMA) of true range values over a specified number of periods, n, with a typical default of 14 periods as originally recommended by J. Welles Wilder Jr.[8][11] This approach smooths the true range data to provide a measure of volatility that responds more quickly to recent price action compared to equal-weighted averages. To initialize the ATR, the first value is calculated as the simple average of the true ranges over the initial n periods: where is the true range for each of the first n periods.[8] Subsequent ATR values are then updated using Wilder's smoothing formula, which applies a weighting factor of : Here, is the current ATR, is the previous ATR, and is the current true range. This method, equivalent to an EMA with a smoothing constant of , was introduced by Wilder in his 1978 book New Concepts in Technical Trading Systems.[11][8] While Wilder's method remains the standard for its reduced lag in volatility estimation, some trading platforms and analysts use a simple moving average (SMA) of the true ranges instead: The SMA assigns equal weight to all n periods, which can introduce more lag but simplifies computation.[11] For illustration, consider n = 3 and initial true range values of 2.5, 3.0, and 2.8. The initial ATR is . For the next period with , the updated ATR is . This process continues iteratively for each new true range.[11] The choice of period n affects the ATR's sensitivity; Wilder's default of 14 is suited for daily charts, while shorter periods (e.g., 7) are common for intraday trading to capture rapid volatility shifts, and longer periods (e.g., 20–50) for weekly or monthly charts to smooth longer-term trends.[8][12] For practical implementation in Python using the pandas library, the following function computes the ATR according to Wilder's method:[13]def atr(df, period=14):
high_low = df['High'] - df['Low']
high_close = np.abs(df['High'] - df['Close'].shift())
low_close = np.abs(df['Low'] - df['Close'].shift())
tr = pd.concat([high_low, high_close, low_close], axis=1).max(axis=1)
return tr.ewm(alpha=1/period, adjust=False).mean()
def atr(df, period=14):
high_low = df['High'] - df['Low']
high_close = np.abs(df['High'] - df['Close'].shift())
low_close = np.abs(df['Low'] - df['Close'].shift())
tr = pd.concat([high_low, high_close, low_close], axis=1).max(axis=1)
return tr.ewm(alpha=1/period, adjust=False).mean()
