accounting for equal highs / equal lows in swing indicator

 

I adapted the 3_bar_swing.mq4 indy to have fewer criteria so that lows are not considered in the downswingbar and highs are not considered in the upswingbar

I would like to adapt it further to cope with situations where there are equal highs and equal lows in the pattern

so, the downswing bar would be - mark the highs that have a lower high after them and where the most recent bar before them, that is not equal to the high, is also a lower high.

vice versa for an upswing bar

Could someone point me to something that outlines the general process of how you would go about doing something like this.

I am very new at this coding thing so apologies if this is a ridiculously basic question.

I hope it is OK to post the indicator with my modifications.

Files:
 
Hi,
Try to use <= instead of < but only at the left checking:
   ...
   if (Low[i] <= Low[i+1] && Low[i] < Low[i-1])
   ...
   if (High[i] >= High[i+1] && High[i] > High[i-1])
   ...
I have seen a similar indicator somewhere, called fine fractals.