---
id: "M:cAlgo.API.Internals.IIndicatorsAccessor.DirectionalMovementSystem(System.Int32)"
kind: "method"
type: "T:cAlgo.API.Internals.IIndicatorsAccessor"
url: "https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/DirectionalMovementSystem/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# IIndicatorsAccessor.DirectionalMovementSystem

Member of [IIndicatorsAccessor](https://help.ctrader.com/ctrader-algo/references/Indicators/IIndicatorsAccessor/index.md).

## DirectionalMovementSystem(int periods)

The Directional Movement System is composed of three indicators that show if the market is trending and provide signals.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
DirectionalMovementSystem DirectionalMovementSystem(int periods)
```

Python:

```python
api.Indicators.DirectionalMovementSystem(periods: int) -> DirectionalMovementSystem
```

### Parameters

- `periods` (`int`, Python `int`): The value of the periods used for calculation.

### Returns

`DirectionalMovementSystem` — Directional Movement System indicator instance

### Examples

C#:

```csharp
var dms = Indicators.DirectionalMovementSystem(14);
if (dms.ADX.LastValue > 25 && dms.DIPlus.LastValue > dms.DIMinus.LastValue)
    Print("Strong up trend, ADX: {0}", dms.ADX.LastValue);
```

Python:

```python
dms = api.Indicators.DirectionalMovementSystem(14)
if dms.ADX.LastValue > 25 and dms.DIPlus.LastValue > dms.DIMinus.LastValue:
    api.Print(f"Strong up trend, ADX: {dms.ADX.LastValue}")
```

## DirectionalMovementSystem(Bars bars, int periods)

The Directional Movement System is composed of three indicators that show if the market is trending and provide signals.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
DirectionalMovementSystem DirectionalMovementSystem(Bars bars, int periods)
```

Python:

```python
api.Indicators.DirectionalMovementSystem(bars: Bars, periods: int) -> DirectionalMovementSystem
```

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars
- `periods` (`int`, Python `int`): The value of the periods used for calculation.

### Returns

`DirectionalMovementSystem` — Directional Movement System indicator instance

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyDms = Indicators.DirectionalMovementSystem(dailyBars, 14);
Print("Daily ADX: {0}, DI+: {1}, DI-: {2}", dailyDms.ADX.LastValue, dailyDms.DIPlus.LastValue, dailyDms.DIMinus.LastValue);
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyDms = api.Indicators.DirectionalMovementSystem(dailyBars, 14)
api.Print(f"Daily ADX: {dailyDms.ADX.LastValue}, DI+: {dailyDms.DIPlus.LastValue}, DI-: {dailyDms.DIMinus.LastValue}")
```

## DirectionalMovementSystem(Bars bars, int periods, MovingAverageType maType)

The Directional Movement System is composed of three indicators that show if the market is trending and provide signals.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
DirectionalMovementSystem DirectionalMovementSystem(Bars bars, int periods, MovingAverageType maType)
```

Python:

```python
api.Indicators.DirectionalMovementSystem(bars: Bars, periods: int, maType: MovingAverageType) -> DirectionalMovementSystem
```

### Parameters

- `bars` (`Bars`, Python `Bars`): The Bars that will be used by indicator, you can pass another timeframe/symbol bars
- `periods` (`int`, Python `int`): The value of the periods used for calculation.
- `maType` (`MovingAverageType`, Python `MovingAverageType`): Method of calculation of MA.

### Returns

`DirectionalMovementSystem` — Directional Movement System indicator instance

### Examples

C#:

```csharp
var dailyBars = MarketData.GetBars(TimeFrame.Daily);
var dailyDms = Indicators.DirectionalMovementSystem(dailyBars, 14, MovingAverageType.Exponential);
Print("Daily ADX (exponential smoothing): {0}", dailyDms.ADX.LastValue);
```

Python:

```python
dailyBars = api.MarketData.GetBars(TimeFrame.Daily)
dailyDms = api.Indicators.DirectionalMovementSystem(dailyBars, 14, MovingAverageType.Exponential)
api.Print(f"Daily ADX (exponential smoothing): {dailyDms.ADX.LastValue}")
```

