weird behaviour of zigzag indicator - page 3

 
Imre Sopp #:

The lag is simply inversely related to the threshold value, which is calculated to the desired deviation value, of course the lag is larger if we try to use larger values ​​as extreme points. Mathematically it is simply not possible to do it differently... So there is no best zif zag algorithm , there is only a choice between the correct and the incorrect option, nothing more is possible! 

I know, although "rules" for new wave can be developed in different ways - for example you can determine new wave by a price percentage change, by a change in points from the highest or lowest, or by other means. In that indicator, it is not evolving the legs, or saying "woops" invalid leg...lag is no problem once the indicator isn't messing things up for the trader, and you could use for example buy limit or sell limit orders at a key location with non-repainting pivot detection...I built this another way as well. There are pros and cons for each the dynamic zigzag and non-repainting zigzag.

Imre Sopp #:

The lag is simply inversely related to the threshold value, which is calculated to the desired deviation value, of course the lag is larger if we try to use larger values ​​as extreme points. Mathematically it is simply not possible to do it differently... So there is no best zif zag algorithm , there is only a choice between the correct and the incorrect option, nothing more is possible! But who are interested to discuss...  Today I just built a new zigzag algorithm that determines basic statistical values ​​and also performs geometric calculations. We get all data only once passing through the raw data, using the (incremental computing) so-called stream processing solution. So we get all the valuable data without using any of additional arrays... Within one move through the source data and in addition to the zigzag movement values (which it would be prudent to store for future processing), the entire statistics are also available in the same pass. The algorithm goes through the history and presents statistics, after which it switches to live processing updating same statistics. In live we compare only the data of the current bar - with the data of previous bar -we use logical layers to manage the rest.... therefore it is extremely effective and optimal... just talking because it's an interesting topic and maybe it will help keep you motivated :)

Feel free to upload anything you want to the codebase when it allows you. You get more rep by continuing to post on the forum. It might ask for a specific number of rep gained before it allows you to submit code.

The zigzag that comes with the metatrader software is very well coded, and I'm not sure if many zigzags stand out against it, but if you have something interesting you can always put it on the codebase.

weird behaviour of zigzag indicator
weird behaviour of zigzag indicator
  • 2025.03.06
  • Conor Mcnamara
  • www.mql5.com
Hey does anyone know why this zigzag indicator is behaving like this. Not marking proper swings? shown by red arrows...