How to get programmatic notification about finishing of Historical Data downloading

 

Hello All,

My question is the following: 

Suppose a script calls a built-in indicator for multiple symbols on a given time frame. The charts for these symbol-time frame pairs were not opened or otherwise refreshed recently. So at first call to the indicator the corresponding historical data are out of date, but this first "touch" on them seems to trigger the downloading of the missing portion of historical data.

The question is "How do I know when the historical data becomes up-to-date?" Is there some kind of synchronous wait function or any other notification to know when the data is safe and current for usage?

 

Thanks and looking forward to your response.

 
tikky20: "How do I know when the historical data becomes up-to-date?" Is there some kind of synchronous wait function or any other notification to know when the data is safe and current for usage?

Indicators will get a new zero IndicatorCounted() so they will auto update.

EA don't look before Bars (iBars) Once history updates so will iBars.

The data is always safe - just check!

 

Hello WHRoeder,

Thank you for the quick ideas!

iBars worked like a charm. I used the following solution in my script: 

   while( iBars(symbol, PERIOD_D1) <= 0 )
   {
      Sleep( 50 );
   }

 

And yes, the data is really always safe and consistent. 

 Thanks again! 

Reason: