Geek's DMI

Not an upgrade as much as a tweek.

DMI+/- are slightly smoother.

ADX was modified to be a field that is negative or positive, the value of which was multiplied to be highly visible.

Hope you like it.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Try this if you don't like the sensitivity of the previous version and prefer a smooth ADX -even simpler to tweak. (no edit option for posts?!)

study(title="Geek's DMI", shorttitle="G_DMI")
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1)

up = change(high)
down = -change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
trur = rma(tr, len)
plus = fixnan(100 * rma(plusDM, len) / trur)
minus = fixnan(100 * rma(minusDM, len) / trur)
sum = plus + minus
adx = 100 * rma((plus - minus) / (sum == 0 ? 1 : sum), lensig)
plot(adx, color=#d0b170, style=area, transp=40, title="DMX")
plot(plus, color=green, title="+DI")
plot(minus, color=red, title="-DI")