Re: ADX DMI Indicators for MT4

421
kmck5147 wrote: Sat Oct 02, 2021 6:07 pm Here is the code.
Fixed post - wrapped code with CODE function.

Please everyone, when posting any code on this site, can we all remember to use the "Code" function in your post so it can be read easily?

If you're unsure on how to, please see below.

Just highlight your code and press the CODE button 👇
Attachments
These users thanked the author Jimmy for the post (total 2):
太虚一毫, Jedidiah
Are you looking for a Forex broker? FBS cuts spreads by up to 58%. Click here to begin your trading journey, today.
No commissions are earned by Forex-station.


Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance


Re: ADX DMI Indicators for MT4

423
kmck5147 wrote: Sat Oct 02, 2021 6:07 pm Here is the code.

Code: Select all

//@version=3
study("Average Directional Index w/ DI", shorttitle="ADX+DI")
adxlen = input(14, title="ADX Smoothing")
dilen = input(14, title="DI Length")
th = input(title="threshold", type=integer, defval=20)
dirmov(len) =>
	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)
	truerange = rma(tr, len)
	
	plus = fixnan(100 * rma(plusDM, len) / truerange)
	minus = fixnan(100 * rma(minusDM, len) / truerange)

	[plus, minus]

adx(dilen, adxlen) =>
	[plus, minus] = dirmov(dilen)
	sum = plus + minus
	adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)

	
[plus, minus] = dirmov(dilen)
sig = adx(dilen, adxlen)


plot(plus, color = green, title="plusDI")
plot(minus, color = red, title="minusDI")
plot(sig, color=white, title="ADX")
hline(th, color=white, linestyle=dashed)
Might check Wilders dmi pretty sure that's the same.

Re: ADX DMI Indicators for MT4

425
太虚一毫 wrote: Fri Oct 22, 2021 12:47 am DSL DMI oscillator (vidya) 1.01, DSL DMI oscillator 2 Both oscillators are good. Expect teacher kvak to choose one at random and add a button. Boundless merit!
Hi, try it.
Update it with autohigher timeframe.
These users thanked the author kvak for the post (total 4):
太虚一毫, camisa, Jimmy, Thangarasu


IdeaRe: ADX DMI Indicators for MT4

427
losajoca wrote: Sat Oct 30, 2021 2:24 am Could be added color to the ADX line (on wilders dmi book), based on slope change?
mrtools wrote: Sat Oct 30, 2021 3:55 am Try.
I know this isn't what you're looking for but just posting Mrtools's Wilders Super Smoother DMI Book in case you'd like to try this indicator with your system. I wonder if it may work a bit better? :)
These users thanked the author Jimmy for the post:
losajoca
Are you looking for a Forex broker? FBS cuts spreads by up to 58%. Click here to begin your trading journey, today.
No commissions are earned by Forex-station.


Guide to the "All Averages" Filters (ADXvma, Laguerre etc.) 🆕
Use Fibonacci numbers for indicator settings + How to draw Fibonacci Extensions
An easy trick for drawing Support & Resistance


Who is online

Users browsing this forum: akeo, ChatGPT [Bot], Yesfx and 81 guests