Compartilhar via


Average True Range Formula (Chart Controls)

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.

Sample plot of the average true range indicator

Formula Details

Syntax

Chart.DataManipulator.FinancialFormula(
    FinancialFormula.AverageTrueRange,
    "Period",
    "High,Low,Close",
    "ATR")

Parameters

This formula takes one optional parameter.

  • Period
    Period for calculating the moving average of the true range values. The default value is 14.

Input Values

This formula takes one input Y value.

  • High
    Daily high price.
  • Low
    Daily low price.
  • Close
    Daily close price.

Output Value

This formula outputs one Y value.

  • ATR
    Average true range indicator.

Remarks

The Line chart type is a convenient chart type to display the formula output.

Example

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.

Chart1.DataManipulator.FinancialFormula (FinancialFormula.AverageTrueRange, "15", "Series1:Y,Series1:Y2,Series1:Y4", "Series3:Y")
Chart1.DataManipulator.FinancialFormula (FinancialFormula.AverageTrueRange, "15", "Series1:Y,Series1:Y2,Series1:Y4", "Series3:Y");

See Also

Reference

System.Windows.Forms.DataVisualization.Charting
System.Web.UI.DataVisualization.Charting

Concepts

Financial Formulas
Applying Formulas