DirectionalMovement.Negative

Calculates the Negative line of the Directional Movement indicator.

Accepts the following parameters:

Parameter NameTypeDefault ValueNotes
periodNumber14-

Returns: Series<Number>

DirectionalMovement.Negative is a built-in function - you can use it directly. Below is an example implementation:

1 function DirectionalMovement.Negative(period = 14):
2 highDelta = high - high[1]
3 lowDelta = low[1] - low
4
5 dmMinus = lowDelta if (lowDelta > highDelta and lowDelta > 0) else 0
6 trueRange = Math.Max(high, close[1]) - Math.Min(low, close[1])
7
8 SMA(dmMinus * 100 / Math.Max(trueRange, 0.00001), period)