Download history in MQL4 EA - page 6

 
William Roeder #:
  1. Why are you using current? That will always be correct. It's purpose is to get other symbols/TFs.

  2. Correct.

  3. Had to go to my sources. Originally had HR2400 86400. Changed it sometime to the above which broke it. Equal precedence, left to right: dt % PERIOD_D1 * 60 not equal to dt % (PERIOD_D1 * 60).

  4. Wouldn't have been a problem if you had used the corrected version which doesn't use TimeOfDay(). Try this:

I still don't get it. Please advice. Lets say I just want to plot a vertical line at 12:00 on a current chart for current timeframe using indicator.

ObjectCreate(0,"VLine",OBJ_VLINE,0,iTime(NULL,0,0)-iTime(NULL,0,0)%HR2400+12*HR0100,0);

I need to download chart history first for the current period to be sure the vertical line will be plotted at 12:00, when I e.g. is manually changing chart symbol. Where should I put this ObjectCreate function? Any code changes should be done?

 

William Roeder #:

That will always be correct.

That's right. In case of PERIOD_CURRENT this method always returns true, even if chart did download some history. How to determine the finish of history downloading on PERIOD_CURRENT?

Reason: