iBars()?
It tells me how many Bars are already locally available.
But I need load the bars in beforehand as the historic-quote request is not thread-safe. That means the calculation goes on even though not all the bars are completely locally available!
iBars()?
It tells me how many Bars are already locally available.
But I need load the bars in beforehand as the historic-quote request is not thread-safe. That means the calculation goes on even though not all the bars are completely locally available!
Why that exclamation mark. I am answering your query what is enough for starting the chart data download from the server.
From my experience, you have no easy tool to learn if the loading has completed. There are some advices in this forum about checking error codes, but you may easily test they do not work.
- You are waiting 15 seconds for all timeframes. If you don't have a large pipe, multiple concurrent downloads may take longer. I suggest waiting for each chart.
void DownloadHistory(ENUM_TIMEFRAMES aPeriod){ ResetLastError(); (void) iOpen(_Symbol,aPeriod,0); if(_LastError != 0){ if(_LastError != ERR_HISTORY_WILL_UPDATED){ Print(_LastError); return; Sleep(15000); RefreshRates(); } }
- You only have to wait if, and only if you get 4066. iOpen, iBars, ect. will all trigger the download start.
- Once started, you get all available OHLCV. One stream.
- Remember this 15 seconds is a one time wait, the first time EA requests other charts. After that you'll have history local and only new bars since last terminal shutdown will have to be sent.
ok, thank you, WHRoeder,
But unfortunately Error 4066 ("Requested history data is in updating state") is totally helpless as this error is set only the first time that the terminal is loading.
Every time after that _LastError signals no error even though the terminal is still loading and quotes locally aren't correct :(
So I have to assume that after the first call of your function DownloadHistory(..) I won't get the 4066 (ERR_HISTORY_WILL_UPDATED).
Or am I wrong?
??
And the second time for the second timeframe and/or the next symbol on the same chart?
Do I get
_LastError != ERR_HISTORY_WILL_UPDATED // this signals ready, all was loaded!!
despite the 'other' history is not loaded completely?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So I load the quotes and wait some time after the request.
My question is simply: is it enough to request just time and open like (simplified code):
or do I have to request all what I will need:
To put in a different way, if I request one value of a bar (op) will all the others (hi,lo,cl,vo) come in too or are they sent by different streams?