Category: Indicator > Volatility Based
True Range measures the conventional range of a bar but checks the previous bar's closing price to see if it is outside the current bar's range. If it is, then that closing price is used instead of the high or low. That is, the previous bar's close is considered part of the current bar's range. This helps account for gaps between bars. The Average True Range indicator calculates and plots the average of these values over a certain number of bars.
This indicator may be considered a tool for measuring the volatility of a market using a price range concept. Often, extremes in Average True Range are associated with a change in character of a market, from trending to trading range and vice versa.
Length - Number of bars used to calculate the Average True Range
IF PLOT1 > HIGHEST(PLOT1, 20) THEN
ALERT("A NEW "+ NUMTOSTR(LENGTH, 0)+" BAR HIGH HAS BEEN MADE")
IF PLOT1 < LOWEST(PLOT1, 20) THEN
ALERT("A NEW "+ NUMTOSTR(LENGTH, 0)+" BAR LOW HAS BEEN MADE");