> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# Directional Movement (DM)

## Description

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

... Courtesy of [Investopedia](http://www.investopedia.com/terms/d/dmi.asp)

## Syntax

`DM(int period)`

`DM(ISeries\<double\> input, int period)`

**Returns default ADX value**

`DM(int period)[int barsAgo]`

`DM(ISeries\<double\> input, int period)[int barsAgo]`

**Returns +DI value**

`DM(int period).DiPlus[int barsAgo]`

`DM(ISeries\<double\> input, int period).DiPlus[int barsAgo]`

**Returns -DI value**

`DM(int period).DiMinus[int barsAgo]`

`DM(ISeries\<double\> 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

| Parameter | Description                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- |
| input     | Indicator source data ([Series\<T>](/developer/desktop-sdk/references/common/iseriest/seriest)) |
| period    | Number of bars used in the calculation                                                          |

## Examples

```csharp
// 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 New > NinjaScript Editor > Indicators within the NinjaTrader Control Center window.