ArrayCopyRates Problem with data

[Deleted]  

Hi, I'm working on an EA, and got a problem, maybe I'm just doing something wrong.

What I need to do is get historical data including the latest bars, for that I use ArrayCopyRates, and it works well if the chart is open on the timeframe I want to take the data from, but lets say I want H4 Timeframe and I open a chart I never opened before and I'm on H1, so basically I never loaded H4 timeframe on the computer. When I ask for the values with ArrayCopyRates for H4 Timeframe It returns no values at all.

Maybe if I open H4 but then go back to H1 then the data will not be updated?, is that how it works?, how can I make sure my data is current even if the timeframe I need was never opened?

Thanks

[Deleted]  
solved, I just need to wait while it downloads, a simple sleep made the trick!
William Roeder
25838
William Roeder  
while(j<10 && (iClose(CurrentSymbol,ServerSyncTimeFrame,2)==0 || GetLastError()==4066))