How can compare current high zigzag value to previous high zigzag value to know Higher low or Higher High in Trend

 

If want to know latest zigzag value , here is code

 int    longRange  = 100;
double highzigzag = 0,
       lowzigzag = 0;

for(int  p= 1;p<longRange;p++){

    highzigzag = 
iCustom(Symbol(),PERIOD_CURRENT,"ZigZag",InpDepth,InpDeviation,InpBackstep,1,p);
   if(highzigzag!=0) break;

}

for(int e = 1;e<longRange;e++){

lowzigzag = 
iCustom(Symbol(),PERIOD_CURRENT,"ZigZag",InpDepth,InpDeviation,InpBackstep,2,e);
if(lowzigzag!=0) break;

}


Comment("hight :"+highzigzag +"\nLow : "+lowzigzag );
if(highzigzag>0)
 {  ARROW("upp", highzigzag, 6, clrBeige);}
 
 if(lowzigzag>0)
 {  ARROW("udd", lowzigzag, 6, clrBeige);}
  

if want to compare latest zigzag high value to previous zigzag high value as show in blue trend line. How can get this previous high zigzag value.

If connect this two point , it show downtrend, So I can know it is Higher Low ,

Please help me ,

 
LONNV: if want to compare latest zigzag high value to previous zigzag high value 
You get the latest, but not the previous. Scan for the previous before the latest (not one).
 
William Roeder #:
You get the latest, but not the previous. Scan for the previous before the latest (not one).

I ask here how to get value of previous high zigzag value , your answer is scan previous one.

How ?

 
I gave you the answer. I'm not going to code it for you.