CopyTime not Working well

 

Mql5 CopyTime reference website tells me this:

"The function gets to time_array history data of bar opening time for the specified symbol-period pair in the specified quantity. It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar."


So if I do:

CopyTime(symbol,PERIOD_M30,0,count,Time);

Then

Time[0] should be the most recent bar on the chart, isn´t it?

But it is not. Comparing it with TimeCurrent() function i get:

2017.05.04 09:56:30.855 webCom (EURUSD,H4) Time[0]:"2017.05.03 11:00"

2017.05.04 09:56:30.855 webCom (EURUSD,H4) TimeCurrent():"2017.05.04 11:56"

almost a day of delay?

Am I doing something wrong?

Thank you.

 
fialhon:

Mql5 CopyTime reference website tells me this:

"The function gets to time_array history data of bar opening time for the specified symbol-period pair in the specified quantity. It should be noted that elements ordering is from present to past, i.e., starting position of 0 means the current bar."


So if I do:

CopyTime(symbol,PERIOD_M30,0,count,Time);

Then

Time[0] should be the most recent bar on the chart, isn´t it?

No it's not. It's only the case if your Time[] array is set as series. With mql5 arrays are NOT set as series by default.
Reason: