Average True Range (ATR)
Previous Topic  Next Topic 

Definition

Courtesy of www.stockcharts.com
Courtesy of www.marketscreen.com

Syntax
ATR(int period)
ATR(IDataSeries inputData, int period)

Returns default value
ATR(int period)[int barsAgo]
ATR(IDataSeries inputData, int period)[int barsAgo]


Return Type
double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.


Parameters

period

The number of bars to include in the calculation

inputData

Indicator source data (?)


Examples

// Prints the current value of a 20 period ATR using default price type
double value = ATR(20)[0];
Print("The current ATR value is " + value.ToString());


Source Code
You can open up the indicator source code via the NinjaScript Editor.