iHighest direction

 

Hello,

How do I tell the iHighest and iLowest commands which direction I want to search. For instance, can I do:

iHighest(NULL,0,MODE_HIGH,-5,8);

to do a search from shift 8 to shift 3 where shift 0 is the last candle, i.e. left to right search. I've tried it but couldn't get it to work.

I'm trying to find the first (in time) highest in a 5 min period where multiple highs of the same price are present. From what I understand iHighest goes from right to left.

Help?

 
  1. Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. The direction it searches is irrevalent, it returns the highest.
 

Sorry, missed the section headings. Will try better next time.

Yes but if there are multiple candles with the same high that are all the highest then I want the function to return the one that is lowest in time.

 
imamushroom: Yes but if there are multiple candles with the same high that are all the highest then I want the function to return the one that is lowest in time.

Then write your own.

Reason: