The DIminus function is part of the Average Directional Index (ADX) technical indicator, specifically representing the negative directional movement indicator (DI-) over a specified number of periods. This function is used to measure the strength of a downward price movement and is often used in conjunction with DIplus to assess the overall trend strength and direction.
DIminus[N](price)
This syntax represents the DIminus function where N is the number of periods over which the indicator is calculated, and price specifies the price type (e.g., close, open, high, low) used in the calculation.
minus = DIminus[14](open)
plus = DIplus[14](open)
IF(minus > plus AND minus[1] < plus[1]) THEN
bull = 1
bear = 0
ENDIF
IF(minus < plus AND minus[1] > plus[1]) THEN
bull = 0
bear = -1
ENDIF
RETURN bull, bear
In this example, the DIminus and DIplus functions are calculated over 14 periods using the opening price. The script then checks for crossovers between the DIminus and DIplus lines to determine bullish or bearish conditions. If DIminus crosses above DIplus, it is considered bullish (bull = 1, bear = 0). Conversely, if DIminus crosses below DIplus, it is considered bearish (bull = 0, bear = -1).
Understanding how to interpret these values in conjunction with other indicators can provide deeper insights into market dynamics.