Use the below code (MT4 & MT5):
int strt= iBarShift(_Symbol,_Period,datetimeA,false); int end= iBarShift(_Symbol,_Period,datetimeB,false); double highest= iHigh(_Symbol,_Period,iHighest(_Symbol,_Period,MODE_HIGH,strt-end+1,end)); double lowest= iLow(_Symbol,_Period,iLowest(_Symbol,_Period,MODE_LOW,strt-end+1,end));

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am trying to loop through the candles to find the highest high and lowest lowest low between time A and time B. How could I go about doing this in MQL5?