NinjaScript > Language Reference > Indicator Methods >

Directional Movement (DM)

Print this Topic Previous pageReturn to chapter overviewNext page

Description

Same as the ADX indicator with the addition of the +DI and -DI values.

 

 

Syntax

DM(int period)
DM(IDataSeries input, int period)

 

Returns default ADX value
DM(int period)[int barsAgo]
DM(IDataSeries input, int period)[int barsAgo]

 

Returns +DI value
DM(int period).DiPlus[int barsAgo]
DM(IDataSeries input, int period).DiPlus[int barsAgo]

 

Returns -DI value
DM(int period).DiMinus[int barsAgo]
DM(IDataSeries input, int period).DiMinus[int barsAgo]

 

 

Return Value

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

 

 

Parameters

input

Indicator source data (?)

period

Number of bars used in the calculation

 

 

Examples

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

 

 

Source Code

You can view this indicator method source code by selecting the menu Tools > Edit NinjaScript > Indicator within the NinjaTrader Control Center window.