4756 views
4756
Combined LazyBears ZeroLag EMA and CapnOscars moving average ADX . Here's the result.

I figured it could be used as a trend trendtrading system,
ADX red + ema cross downards = short.
ADX green + ema cross up = long.
Or something along those line. A way filter out whipsaws.
This is just something I threw together in 5 min, so din't go all in tho. Haven't had time to test.
3 Z-EMAs
Colors/settings can be customized.
```//
len=input(20)
len2=input(50)
len3=input(200)
src=close
//EMA1
ema1=ema(src, len)
ema2=ema(ema1, len)
d=ema1-ema2
zlema=ema1+d
//EMA2
ema1b=ema(src, len2)
ema2b=ema(ema1b, len2)
db=ema1b-ema2b
zlemab=ema1b+db
//EMA3
ema1c=ema(src, len3)
ema2c=ema(ema1, len3)
dc=ema1c-ema2c
zlemac=ema1c+dc
lenadx = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)

up = change(high)
down = -change(low)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, lenadx) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, lenadx) / trur)
sum = plus + minus
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

lenadxB = input(14, minval=1, title="DI Length")
lensigB = input(14, title="ADX Smoothing", minval=1, maxval=50)

upB = change(high)
downB = -change(low)
plusB = fixnan(100 * rma(upB > downB and upB > 0 ? up : 0, lenadxB) / trurB)
minusB = fixnan(100 * rma(downB > upB and downB > 0 ? downB : 0, lenadxB) / trurB)
sumB = plusB + minusB
adxB = 100 * rma(abs(plusB - minusB) / (sumB == 0 ? 1 : sumB), lensigB)