Errors, bugs, questions - page 1442

 
Yousufkhodja Sultonov:
Please tell me how to overcome the situation when the tester limits the number of open positions to a hundred, despite the fact that, in the settings I specify 1000?
You can't, this is not a limitation of the terminal but of the broker, open a demo account with a broker that gives more than 100 orders
 

Read aboutCopyRates() thoughtfully:

Note

1. If the interval of data requested is completely outside the available data on the server, the function returns -1. If the data requested is outside TERMINAL_MAXBARS (maximal amount of bars on the chart), the function will also return -1.

2. When requesting data from the indicator, if the requested timeseries haven't been built yet or they need to be downloaded from the server, the function will return -1 immediately, but the downloading/build process itself will be initiated.

3. When requesting the data from the Expert Advisor or a script, the downloading from the server will be initiated, if the terminal does not have these data locally, or the building of the required timeseries will begin, if the data can be built from the local history, but they are not ready yet. The function will return the amount of data that will be ready when the timeout expires, but history will continue to be downloaded, and the next time a similar request is made, the function will return more data.

1. this is correct and logical, before requesting data, you should check the allowed number of bars in the window.

2) You are also correct; you must try to receive data until the terminal returns the required amount, remembering to check the connection with the server. There is no doubt about quality of received data here - data is either there or not.

3. here it is not clear at all. You can never be sure that the received data is complete. And why would the user need data which are not sure of their completeness? Practice shows that no tricks (preliminary attempts to get data in order to initialize downloading from the server) do not give confidence that the request will get complete data.

I think that it is more practical to make the behaviour of functions of data retrieval in Expert Advisors similar to the indicators.

 
Joo Zepper:

Read aboutCopyRates() thoughtfully:


3. This is where it is not clear at all. You can never be sure that the received data is complete. And why should the user need data which are incomplete? Practice shows that no tricks (preliminary attempts to get data to initiate downloading from the server) make you confident that the request will get complete data.

Why can't you be sure? Use SeriesInfoInteger(symbol,period,SERIES_SYNCHRONIZED) to be sure.

Keep reading the documentation. As thoughtfully as possible.

 
Slawa:

Why can't you be sure? To be sure, use SeriesInfoInteger(symbol,period,SERIES_SYNCHRONIZED)

Keep reading the documentation. Do not be less thoughtful.

Thanks for the tip, but I've been using this flag for a long time. Are there any other more reliable ways?

I'm also waiting for your next suggestion - to open the chart window of the requested instrument. And this is done, but the full data is not guaranteed.

 
Joo Zepper:
Thanks for the tip, but checking this flag has been in active use by me for a long time. Are there any other more reliable ways?

What's the problem then? If this flag is set to true, the current data is fully synchronized. They may be incomplete because the server has more data than you do - the story goes deeper

Then query history in full depth and check SeriesInfoInteger(symbol,PERIOD_M1,SERIES_SERVER_FIRSTDATE) against the first date of your local minutes

 
Slawa:

What is the problem then? If this flag is set to true, the current data is fully synchronised. They may be incomplete because the server has more data than you do - the story goes deeper

Then query history in full depth and check SeriesInfoInteger(symbol,PERIOD_M1,SERIES_SERVER_FIRSTDATE) against the first date of your local minutes

But this is suicide for the Expert Advisor. You will get terrible lags. And you do not need, as a rule, a full-depth history.

I think about this. In the market report always the latest data and if the terminal cannot provide the necessary amount of data on request within the limits of the server's history and the allowed number of bars in the window, in such cases, return -1, as in indicators. Either get data or -1, there is no third option.

 

I do this before requesting data:

for(int attempt = 0; attempt < 10; attempt++) 
  {
    bool flag = true; 
    for(int symb = 0; symb < SymbolCNT; symb++) 
    {
      if(!synched[symb]) 
      {
        // trial copying of price data
        int copied = CopyRates(symbsName[symb], smPeriod, startPosDataGet, barsReq, prices[symb].Data); 
        
        if(copied >= barsReq) 
        {
          if(idChart[symb] != -1) 
          {
            ChartClose(idChart[symb]); 
            idChart[symb] = -1;
          }
          synched[symb] = true;
        }
        else 
        {
          flag = false; 
          if(showAlert) 
            Alert(symbsName[symb] + ": requested/received " + (string)barsReq + "/" + (string)copied); 
          
          if(idChart[symb] == -1) 
          {
            idChart[symb] = ChartOpen(symbsName[symb], smPeriod); 
            ChartSetInteger(ChartFirst(), CHART_BRING_TO_TOP, 0, true);
          }
        }
      }
    }
    if(!flag) 
      if(TerminalInfoInteger(TERMINAL_CONNECTED)) 
        Sleep(1000);
  }
  
  for(int symb = 0; symb < SymbolCNT; symb++) 
    if(idChart[symb] != -1) 
      ChartClose(idChart[symb]); 

But already during direct queries the data comes with holes. Sometimes without holes. That's what I'm talking about - no confidence in the data received.

 
Karputov Vladimir:

Video inserted via the message editor is not saved.

Google Chrome Version 46.0.2490.86 m.

Internet Explorer 11.11.10586.0.

The error will be fixed, thanks for the message.
 

The regular indicators are NOT working after updating the system to Windows10. It is simply not possible to attach to the graphics. In the editor, an error is displayed when compiling

error

 
Alexandr:
The regular indicators are NOT working after updating the system to Windows10. Simply cannot be attached to the graphics. In the editor, the error https://i.gyazo.com/5dbea3b25ab9a45cf3a9449335c1f57f.png appears when compiling.
Probably something with access rights, check if the terminal folders are writable, try lowering UAC ....