AverageTrueRange

Category: Indicators

The Average True Range (ATR) is a technical indicator used to measure market volatility. It was introduced by J. Welles Wilder Jr. in his book “New Concepts in Technical Trading Systems.” The ATR indicator does not indicate price direction, but rather the degree of price movement or volatility within a given period of time.

Syntax:

AverageTrueRange[N](price)

This function takes two parameters:

  • N: The period over which the ATR is calculated.
  • price: The price component (usually the closing price) used in the calculation.

Calculation:

The ATR is calculated by first determining the True Range (TR), which is the greatest of the following:

  • The difference between today’s high and today’s low.
  • The absolute difference between today’s high and yesterday’s close.
  • The absolute difference between today’s low and yesterday’s close.

Once the True Range is determined for each period, a Wilder’s moving average (specifically designed for the ATR) is applied to these values over ‘N’ periods to compute the Average True Range.

Example:

ATR = AverageTrueRange[14](close)
RETURN ATR coloured(100,0,0)

This example calculates the 14-period ATR based on the closing prices and colors the output in red (RGB: 100, 0, 0).

Additional Information:

The ATR is particularly useful in trading systems to adjust levels of stop-loss orders or to determine entry and exit points based on levels of volatility. An increasing ATR indicates rising volatility, while a decreasing ATR suggests declining volatility. The ATR, however, does not provide any information regarding price direction or duration, only the volatility level.

Related Instructions:

  • TR indicators
  • Logo Logo
    Loading...