DIplus
DIplus in ProBuilder returns the positive directional indicator (DI+) of the ADX system, measuring upward price movement strength. Syntax and examples.
Syntax
DIplus[N](price)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
N | integer | 14 | Number of periods for the calculation, applied to both the directional movement smoothing and the ATR. |
price | price source | close | Price argument passed to the instruction, typically close. |
Formula
+DM = current high - previous high (kept only when positive
and greater than the downward movement, else 0)
DIplus = 100 * WilderSmoothing[N](+DM) / AverageTrueRange[N]Dividing by the ATR expresses upward movement as a share of total range, making the value comparable across instruments and volatility regimes.
How it works
For each bar, the system measures how far the high extended above the previous high. That distance counts as positive directional movement, but only when it is larger than the bar's downward extension; otherwise the bar contributes zero. The positive movements are smoothed with Wilder's method over N bars, divided by the ATR over the same window, and scaled to 0 to 100.
The line rises while the market keeps printing higher highs and decays when upward pressure stalls. Interpretation is always relative to DIminus: DI+ on top means buyers control directional movement, and the crossover of the two lines is the primitive signal of the Directional Movement System. Trend strength is delegated to ADX, which is built from the same inputs.
Changing N adjusts sensitivity. Shorter periods make the line react to individual breakout bars, longer periods favour sustained trends over single expansions.
Examples
Example 1, Directional crossover signals (Indicator)
// 14-period directional indicators on the open
minus = DIminus[14](open)
plus = DIplus[14](open)
// Bullish signal: DI+ crosses above DI-
IF (plus > minus AND plus[1] < minus[1]) THEN
bull = 1
bear = 0
ENDIF
// Bearish signal: DI+ crosses below DI-
IF (plus < minus AND plus[1] > minus[1]) THEN
bull = 0
bear = -1
ENDIF
RETURN bull, bearFlags the bar where DI+ overtakes DI- as bullish (1) and the bar where it drops back below as bearish (-1). The signal state persists between crossings because the variables keep their last assigned value.
Example 2, Uptrend screener with strength filter (ProScreener)
// Instruments in a confirmed uptrend: DI+ above DI- and ADX above 25
plus = DIplus[14](close)
minus = DIminus[14](close)
trendStrength = ADX[14]
SCREENER[plus > minus AND trendStrength > 25](plus - minus AS "DI+ lead")Returns instruments where upward movement dominates and the ADX confirms a trending market, ranked by how far DI+ leads DI-.
Example 3, Long entry on a bullish crossover (ProBacktest)
// Enter long when DI+ overtakes DI- in a trending market
plus = DIplus[14](close)
minus = DIminus[14](close)
IF NOT LongOnMarket AND ADX[14] > 20 AND plus CROSSES OVER minus THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND plus CROSSES UNDER minus THEN
SELL AT MARKET
ENDIFThe classic Wilder entry: buy the DI+ over DI- crossover when ADX confirms strength, exit when the crossover reverses.
Interpretation
- DI+ above DI-. Upward directional movement dominates the window. Traditional reading: uptrend, more reliable when
ADXexceeds roughly 20 to 25. - DI+ below DI-. Downward movement dominates, bullish pressure is secondary.
- DI+ crossing above DI-. The standard bullish trigger of the system.
- Both lines low and intertwined. Neither side controls the market; crossover signals in this state are mostly noise.
Common errors and gotchas
- Using DI+ without DI-. A high DI+ value alone does not establish an uptrend, since DI- may be higher still. Compare both lines or use the combined
DIdifference. - Crossover conditions written backwards. With two similar variable names,
minus CROSSES OVER plusandplus CROSSES OVER minusare one transposition apart and produce opposite systems. Name variables explicitly and verify the direction of each condition. - Signals in flat markets. Without an
ADXfilter the DI lines cross frequently in ranges. RequiringADX[14] > 20, as in Example 3, removes many low-quality triggers. - Sensitivity to the period. Small
Nvalues let one wide bar dominate the reading, large values delay crossover signals. Change the period on both DI lines together, never on one side only.
Related instructions
DIminus, the negative counterpart measuring downward movement.DI, single-line difference DI+ minus DI-.ADX, trend strength derived from the DI lines.ADXR, smoothed ADX variant.AverageTrueRange, the volatility normaliser in the formula.TR, single-bar true range.VIplus, positive vortex line, a related upward-movement measure.VIminus, negative vortex line.
