Why are price at given time different on different TFs ?

 

I ran into some problems with my code, and traced it down to an oddity:

I thought the price e.g. at EURUSD H1 '2009.02.11 08:00' would be the same as at EURUSD M1 '2009.02.11 08:00'... apparently it is not.

Because if I zoom in on that particcular bar, on TF M1 I get a very different price than on H1. This totally upsets my 'machine'

Can someone explain what is going on?

Here is the indicator code I used to investigate this phenomenon:

#property indicator_separate_window   

int start() {
double ClosePriceH1,ClosePriceM1;
datetime time = D'2009.02.11 08:00';

   //------- Draw a Vline at the point of interest ------
   ObjectCreate( "UpLine00", OBJ_VLINE, 0, time, 0);
   ObjectSet("UpLine00", OBJPROP_COLOR, Lime);
   ObjectSet("UpLine00", OBJPROP_BACK,true); 

   int shift = iBarShift(Symbol(),PERIOD_H1, time);
   ClosePriceH1=iClose(NULL, 60, shift);//Price from H1
   ClosePriceM1=iClose(NULL, 1, shift); //Price from M1, they are different!!
         
   Comment("At "+TimeToStr(time)+"  ClosePriceH1=",ClosePriceH1,"  ClosePriceM1=",ClosePriceM1 );

return(0);
}


Any help greatly apprechiated!

E.K

 

Maybe only open prices of them are same.

Close of '2009.02.11 08:00' is the close of '2009.02.11 08:59' .

to sure what is Open High Low and Close !

M1 = each period of 00 to 59 second

H1 = each period of 00:00 to 59:59