Average Directional Index (ADX)
Previous Topic  Next Topic 

Definition

Courtesy of www.stockcharts.com

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

Returns default value
ADX(int period)[int barsAgo]
ADX(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 ADX using default price type
double value = ADX(20)[0];
Print("The current ADX value is " + value.ToString());

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


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