Indicators: Fast ZigZag - page 6

 
Karlson:

Except for my first drawing of the left element. Apparently there is a very low-bar low.

 
Yurich:
I made a mistake above, ao is the zero buffer, ema is the second buffer, the first buffer is your colour index.
I'm an idiot. I didn't look at my own buffers.
 

The Best! Thank you.

Just what I needed.

Files:
 

I got one of these. It's not the first time. When loading the terminal.

2012.11.27 23:45:03 fastzz(NZDUSD,M1) array out of range in 'fastzz.mq5' (75,23)

 
TheXpert:

I got one of these. It's not the first time. When loading the terminal.

2012.11.27 23:45:03 fastzz (NZDUSD,M1) array out of range in 'fastzz.mq5' (75,23)

Thank you.

I need to add the highlighted text to the code.

  {
   if(calculated==0) last=0;
   for(int i=calculated>0?calculated-1:0; i<total-1; i++)

I have updated the publication.

 
Yurich:

Thank you.

I need to add the highlighted text to the code.

I've updated the publication.

Published.
 

To Yurich:

I tried to extract the values of the last established vertices from the proposed ZZ algorithm. The result of this attempt is in the attached file. The variables A,B and C are supposed to always contain the values of the last established vertices of the zigzag.

I could not understand all the intricacies of the ZZ algorithm, so the question is.

Will the variables A,B and C in the above code contain correct values in all situations? If not, what do I need to adjust?

 
victorg:

Will variables A,B and C in the above code contain correct values in all situations? If not, what should be corrected?

Corrected ... I added a variable D containing the value of the forming extremum, it may come in handy :)

It should work correctly, but I haven't checked it on history.

 
Yurich:

Adjusted ... Added a variable D containing the value of the forming extremum, it may come in handy :)

It should work correctly, but I haven't checked it on history.

Thank you very much!
 
Yurich:

Adjusted ... Added a variable D containing the value of the forming extremum, it may come in handy :)

It should work correctly, but I haven't checked it on history.

The proposed code does not always work correctly. As a result, I decided on the following variant. Although I am not completely sure about it.

Files: