Bug in ZIGZAG indicator
-
Helow,
This simple bot buys when the price breaks the resistance defined by the last high (constant high = 1, configurable) of the zigzag indicagtor. And sells when the price breaks the support defined by the last low (constant low = 1, configurable) of the zigzag indicator. Well, backtesting the bot in visual mode, you can see that sometimes the bot buys/sells with the break of the last high/low (correct), but other times, the bot buys/sells with the break of the penultimate high/low (incorrect). -
Draw a line on these levels so you can visually see what is happening.
-
I know this case. For some reason the value of highs and lows is following an apparently incoherent sequence. On of the reasons why I simply stopped using Zigzag is because of that. Sometimes high 0 is the closest high to the current value and other times it is the second closest one for no apparent reason. Is the admin modifying the indicator maybe?
-
That is why I said to draw a line, once you know if it is using the correct one, you can set a test to see if the correct value is < or >, so you only use the value you want.
-
Hellow guys, thanks for your answers. It’s like l’Andorrà says, the value of highs and lows is following an apparently incoherent sequence.
-
The sequence of ZZ is set by the ZZ indicator, so you need to decide what ZZ point you want to use, the sequence is not incoherent.
-
@jstap I'm afraid not, my friend. Something is seriously wrong with Zigzag. Just take this example:
https://fxdreema.com/shared/pac4HNnrd
Look at its result on the chart just by selecting high 0 and low 0:

For some reason the third high in the past is considered as high 0 while low 0 is correct. Definitely the admin should take a look at it.
-
Nothing strange in my opinion, because zig-zag high 0 and low 0 give us the value of the last LEG , not the corner between two leg. When a new leg appears the value changes.


-
There was a time when I used ZZ for months, and it always gave me the result I wanted and expected. Maybe something is wrong now. it can repaint on the current leg but all before was as the dot showed.
-
@ambrogio And how can you explain the value provided in my example is 6!!! legs away?
-
@l-andorrà It's a pure coincidence with the value of the new leg that is forming. If you slow down the visual backtest you can see it.

-
Definitely the admin touched something. Now the bug is over. Thank you for your suggestions ambrogio.