TradingView
GeekWithAKnife
Jun 9, 2018 10:45 AM
Geek's DMI
BITFINEX:BTCUSD
1D
Bitcoin / Dollar
Bitfinex
Description
⋅
Jun 9, 2018 10:45 AM
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.
Directional Movement Index (DMI)
Comments
GeekWithAKnife
⋅
Jun 16, 2018 9:37 AM
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?!)
//
@version
=4
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")
More
//@version=4
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")