iTime() does not report updaed values

 

I have iTime in an infinite loop and monitor new bar using iTime() but for 1 minute bars, it does not update every minute. I tried to use RefreshRates(); inside the loop but it did not help. Here is the code


while(true){

datetime TF_Time = iTime(NULL,1,0);

Sleep(60*1000);

}

TF_Time value is updated at very first time and after 60 seconds, TF_Time value is expected to change but it does not. Rather it reports the previously recorded value. Please let me know if any one can help with that.


Thanks,

 
Use function RefreshRates.
 
Rosh:
Use function RefreshRates.

Rosh, as i mentioned earlier, I already used RefreshRates() but it does not work always. Please tell me if there is any solution for that. Thanks

 

For example:

datetime TF_Time;
 
while(!IsStopped())
    {     
    RefreshRates();
    TF_Time = iTime(NULL,1,0);
 
    Sleep(60*1000);
    }
And check for error 4066 as shown in https://docs.mql4.com/array/ArrayCopySeries
 
Rosh:

For example:

And check for error 4066 as shown in https://docs.mql4.com/array/ArrayCopySeries

Thanks for your reply.