Binary indicator which adopts the Zigzag mechanism but as opposed to the above two indicators, it gives always valid signals about the direction of a trend and shows when that trend was confirmed.
It does not show peaks and troughs like Zigzag, but returns +1 for valid up trends and -1 for valid downtrends and it rejects all the invalid trends.
The real power of ZZT is that its signals are never revisable, so you can let the indicator provide valid signals for both the past and the present.
// price value
price = close
// ZigZag method : 1=percent, 2=points
method = 1
// Reversal amount
amnt = 10
IF method=1 THEN
zz0 = ZigZag[amnt](price)
ELSE
zz0 = ZigZagPoint[amnt](price)
ENDIF
zz1 = zz0[1]
zz2 = zz0[2]
IF zz0 > zz1 AND zz1 < zz2 THEN
ztr = zz1
ENDIF
IF zz0 < zz1 AND zz1 > zz2 THEN
zpk = zz1
ENDIF
IF method=1 THEN
PU = ztr + Abs(ztr) * amnt / 100
ELSE
PU = ztr + amnt
ENDIF
IF method=1 THEN
PD = zpk - Abs(zpk) * amnt / 100
ELSE
PD = zpk - amnt
ENDIF
IF price >= PU AND zz0 > zz1 THEN
res = 1
ELSIF price <= PD AND zz0 < zz1 THEN
res = -1
ELSE
res = 0
ENDIF
RETURN res AS"ZZT"