Bar High and Low at specific time

 

Can someone show me some code simple code that will allow me to capture the high and low of a Bar at a specified time?

For example ... how do I capture the high and low of a bar at 1:00 GMT?

 
datetime some_time=D'1:00';
int      shift=iBarShift("EUROUSD",PERIOD_H1,some_time);
double highprice=iHigh("EURUSD",PERIOD_H1,shift);
double lowprice= iLow("EURUSD",PERIOD_H1,shift); 
 

how to use two time period, i.e 1:00 to 5:00 of highest high and lowest low..

 
052ac1416:

how to use two time period, i.e 1:00 to 5:00 of highest high and lowest low..

If this thread doesn't answer your question start your own thread.
 
Roger:
datetime some_time=D'1:00';

D'1:00' is 1 AM on the day the EA/Script was COMPILED not 1 AM today.

either timeToStr("1:00") or

datetime now   = Time[0],
         bod   = now - now % 86400, // Beginning of the day (0000)
         oneAM = bod + 3600;
 
and how to use the 4-hour or 8 hour ago (seen at that point in time that move)
 
datetime now = TimeCurrent(),
         hr8ago = now - 8 * 3600;
int      iHr8ago = iBarShift(NULL, PERIOD_H1, hr8ago);
double   High8to7= iHigh(NULL, PERIOD_H1, iHr8ago);
Print(...

learn to code
Reason: