How to get high/low value from within custom time span?

 

I've got an indicator that shows previous day's high and low and I'm pretty clear what is happening in the code. I'm trying to modify it so the high and low values can be taken from within a custom time span. In the indicator there's two variables; R returns yesterday's high and P shows the low. I need to use the values in an EA and the drawing feature of the indicator is moot really -- I just need the values calculated.


Basically, I just need help getting high and low values from between 8am and 1pm -- or any custom time span -- as opposed to just plain day high/low.


Any ideas?


Thanks

 
look here: https://docs.mql4.com/series/iHighest
Reason: