Skip to content

IIndicatorsAccessor.DirectionalMovementSystem

method · IIndicatorsAccessor · cAlgo.API.Internals

DesktopCLICloud

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

Overloads

DirectionalMovementSystem(int periods)

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

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

Parameters

Name C# type Python type Description
periods int int The value of the periods used for calculation.

Returns DirectionalMovementSystem — Directional Movement System indicator instance

Examples

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);
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.

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

Parameters

Name C# type Python type Description
bars Bars Bars The Bars that will be used by indicator, you can pass another timeframe/symbol bars
periods int int The value of the periods used for calculation.

Returns DirectionalMovementSystem — Directional Movement System indicator instance

Examples

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);
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.

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

Parameters

Name C# type Python type Description
bars Bars Bars The Bars that will be used by indicator, you can pass another timeframe/symbol bars
periods int int The value of the periods used for calculation.
maType MovingAverageType MovingAverageType Method of calculation of MA.

Returns DirectionalMovementSystem — Directional Movement System indicator instance

Examples

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