Average True Range Formula
The average true range formula records the maximum values of the following three differences, and calculates the moving average of the resulting data series:
Between the previous day's high and low prices.
Between the previous day's close price and the current day's high price.
Between the previous day's close price and the current day's low price.
The average true range indicator is a good measure of commitment. A high value often indicates market bottom due to panic sell. A low value often indicates market top.
Chart.DataManipulator.FinancialFormula( FinancialFormula.AverageTrueRange, "Period", "High,Low,Close", "ATR")
This formula takes one optional parameter.
- Period for calculating the moving average of the true range values. The default value is 14.
This formula takes one input Y value.
- Daily high price.
- Daily low price.
- Daily close price.
This formula outputs one Y value.
- Average true range indicator.
The following example takes input from Series1's Y values for the daily high, low, and close prices (Series1:Y,Series1:Y2,Series1:Y4), and outputs the average true range indicator on Series3 (Series3:Y). It uses a period of 15 days to calculate the moving average of the true range values.