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"
You must be logged in to post a comment.
I'm interested in this indicator but it does not appear to work on 10.3. Could it be possible for someone to get it working on 10.3? Or maybe I'm just applying it incorrectly as I am a newbie to importing indicators to PRT.
I'm also a little confused by the image shown as a zigzag is normally either trending up or down and so the result shown would be either +1 or -1 but the image shows a lot of zero.
Thanks for any help with this.
Chris
Thanks for your reply - I had tried that - I set the amnt to 1 on a 15 min GBPUSD chart and could see no results except zero. I have now tried it on a daily chart and see that I get some results but they do not seem to agree in anyway to the standard zig zag set to 1% on the chart. I am still confused as to what exactly the +1 zero and -1 actually represent. Is there anyway to get an indicator that just returns +1 or -1 depending upon whether a zigzag is trending up or trending down at any moment in time?
Chris