Discussion of article "Developing the oscillator-based ZigZag indicator. Example of executing a requirements specification"

 

New article Developing the oscillator-based ZigZag indicator. Example of executing a requirements specification has been published:

The article demonstrates the development of the ZigZag indicator in accordance with one of the sample specifications described in the article "How to prepare Requirements Specification when ordering an indicator". The indicator is built by extreme values defined using an oscillator. There is an ability to use one of five oscillators: WPR, CCI, Chaikin, RSI or Stochastic Oscillator.

The article "How to prepare Requirements Specification when ordering an indicator" features a sample Requirements Specification for the development of a ZigZag indicator based on various oscillators. In this article, I will show you how to execute this task step by step.

Oscillator-based ZigZag indicator

Author: Dmitry Fedoseev

 

1.OscZigZagStep1 indicator code.

      // if on this bar was new dot, delete it and draw old ones
      if(NewDotTime==time[i]){
         ZigZagBuffer[NewDotBar]=0;  
      }
      // and draw old ones
      ZigZagBuffer[(int)lhb[i]]=high[(int)lhb[i]];
      ZigZagBuffer[(int)llb[i]]=low[(int)llb[i]];      
      
      ZigZagBuffer[i]=0;

Yes, but when changing the direction NewDotBar=hb and lhb[i]=hb. Here ZigZagBuffer is first equated to zero and then the same value is returned to it as it was. ZigZagBuffer [(int)lhb[i]]=ZigZagBuffer[NewDotBar]=ZigZagBuffer[hb]. I don't understand what the point is here. The value is first reset to zero then the same value is assigned.

2. indicator on EURUSD 06/06/19

byl.r

There should not be any top here

 
Photic:

1.Indicator code OscZigZagStep1

Yes, but when changing the direction NewDotBar=hb and lhb[i]=hb. Here ZigZagBuffer is first equated to zero and then the same value is returned to it as it was. ZigZagBuffer [(int)lhb[i]]=ZigZagBuffer[NewDotBar]=ZigZagBuffer[hb]. I don't understand what the point is here. The value is first zeroed then the same value is assigned.

2. indicator on EURUSD 06/06/19

There should not be any top here

1. This is due to the fact that on the forming bar a new zigzag segment can disappear. And after the new segment disappears, the hb is not the same, but the old one, from the previously formed top.

2. Not the fact that it shouldn't. Is there an oscillator in the subwindow that is used to build a zigzag? But the direction is determined by it, and the minimum and maximum are determined by the price. If you look at the oscillator on the bar that is circled, there is a low. Further the oscillator falls even lower, but the price is not falling. ..... Nah. It's probably the wrong low. The downward direction should have appeared at about 3:00 (or 7:00), but on the whole interval from the last high to 3:00 the minimum price is exactly on this circled bar.

...and if it seems like the wrong zigzag to you, it may not be the right zigzag for you. After reading the article carefully you can write yourself any zigzag you want.
 
Dmitry Fedoseev:

1. this is due to the fact that on the forming bar a new zigzag segment can disappear. And after the new segment disappears, hb is not the same, but the old one, from the previously formed top.

2. Not the fact that it shouldn't. Is there an oscillator in the subwindow that is used to build a zigzag? But the direction is determined by it, and the minimum and maximum are determined by the price. If you look at the oscillator on the bar that is circled, there is a low. Further the oscillator falls even lower, but the price is not falling. ..... Nah. It's probably the wrong low. The downward direction should have appeared at about 3:00 (or 7:00), but on the whole interval from the last high to 3:00 the minimum price is exactly on this circled bar.

...and if it seems like the wrong zigzag to you, then maybe this is not the right zigzag for you. After reading the article carefully you can write any zigzag you want for yourself.

1. The first question disappeared together with the heat

2. From the article and the code I understood that max/min is searched for when changing direction or is corrected as you move. But on the circled section there is no change of direction, dir =1 both before and after. So why and when is the minimum being looked for here. On 7 June at 7:00 when changing dir=1 to dir=-1 the maximum is searched on this section and that's all. I must have missed something somewhere.

 
It finally rained and the picture seems to be clearing up.
 
Photic:

1. The first question fell away with the heat

2. From the article and code I understood that max/min is searched when changing direction or is corrected as you move. But on the circled section there is no change of direction, dir =1 both before and after. So why and when is the minimum being looked for here. On 7 June at 7:00 when changing dir=1 to dir=-1 the maximum is searched on this section and that's all. I must have missed something somewhere.

2. The direction has changed, and at the moment of direction change the minimum is searched on the whole interval from the last peak to the place of direction change.

 
is there one on MT4?