Finding highest/lowest fractal in past X candles

 
[DELETED]
 
Idi: How do I find the lowest/highest fractal in the past X candles in mql4?

When in doubt, think!

Not compiled, not tested, just typed.

double highest=DBL_MIN, lowest=DBL_MAX;
for(int iBar=3, iBar <= X, ++iBar){
   double t=iFractals(_Symbol, timeframe, MODE_UPPER, iBar); if(t!=0 && highest < t) highest=t;
          t=iFractals(_Symbol, timeframe, MODE_LOWER, iBar); if(t!=0 && lowest  > t) lowest =t;
}

Not compiled, not tested, just typed.

Was that so hard you couldn't even attempt it?