indicator · own pane · open source

ADX and DI

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

ADX with +DI and -DI in one pane. ADX measures trend strength regardless of direction; +DI/-DI tell you which side is winning.

  • ADX above 25 = a trend worth following.
  • +DI over -DI = bulls in control, the opposite = bears.
  • Great filter for any breakout or mean-reversion system.

Source code

//@version=5
indicator("ADX and DI", overlay=false)
len = input.int(14, "DI Length", minval=2)
smooth = input.int(14, "ADX Smoothing", minval=1)
[plus, minus, adx] = ta.dmi(len, smooth)
hline(25, "Trend Threshold", color=color.gray, linestyle=hline.style_dashed)
p_ADX = plot(adx, "ADX", color=color.orange, linewidth=2)
p_Plus_DI = plot(plus, "Plus DI", color=color.green)
p_Minus_DI = plot(minus, "Minus DI", color=color.red)
alertcondition(ta.crossover(adx, 25), "ADX crosses 25 up", "ADX entered a trending regime")
alertcondition(ta.crossover(plus, minus), "+DI crosses -DI up", "Directional bias flipped bullish")

Comments

No comments yet.

Sign in to comment.