Different time frames - different close values?

Back to topics list To post a new topic, please log in or register
avatar
2
Michal_Jurnik 2015.03.03 17:41
 

Hi there,

 I would like to ask why Close values are not same for different time frames. I have bars from PERIOD_M1 and PERIOD_M5 with same datetime but with different Close values.

Example:

2015.03.03 17:34:01.437 USDCAD,M5: 2015.03.03 17:40:00 | 2015.03.03 17:40:00        1.24416 | 1.2443
2015.03.03 17:34:01.436 USDCAD,M5: 2015.03.03 17:40:00 | 2015.03.03 17:40:00        0.75609 | 0.7562

 

Code: 

 

datetime time = iTime(symbol,PERIOD_M5, 10);
int shift = iBarShift(symbol, PERIOD_M1, time);
   
Print(time, " | ",  iTime(symbol, PERIOD_M1, shift), "        ", iClose(symbol, PERIOD_M5, 10), " | ", iClose(symbol, PERIOD_M1, iBarShift(symbol, PERIOD_M1, time)));
  

 

How is it possible that they are different? Many thanks for reply!

 

avatar
Moderator
3406
GumRai 2015.03.03 18:17 #
 
Because the 17:40 M1 bar closes at 17:41 and the 17:40 M5 bar closes at 17:45
avatar
2
Michal_Jurnik 2015.03.03 18:40 #
 
GumRai:
Because the 17:40 M1 bar closes at 17:41 and the 17:40 M5 bar closes at 17:45
Thank you for good idea GumRai!
Back to topics list  

To add comments, please log in or register