Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 913

 
psyman:


How can I make sure that the data is uploaded?

I've read the "Organising Data Access" help, but I wonder if there is a simple way to make sure.

https://www.mql5.com/ru/code/1251

there's this code in the mt5 help

What do you mean by "an easy way"? - ...Is it just a way to check if the data was uploaded by mind? ))) - You either write everything yourself from scratch or use someone else's ready-made solutions, either the first or the second case requires time - either to write and develop your own code or to deal with someone else's solution, which is easier - your choice

 
Igor Makanu:

https://www.mql5.com/ru/code/1251

this code is in the mt5 help

what do you mean the easy way? - by force of mind? ))) - You either write everything yourself from scratch or use someone else's solution, in both cases it takes time - either to write and develop your own code or to deal with someone else's solution, what is easier - your choice

Thanks for the link, the library is an easy way :-)

It's true, I've read comments saying it freezes in some cases.

As far as I understand, asynchronous piping for one copy of an indicator is impossible. I should wait for it to successively handle the whole queue for each symbol?

 
psyman:

Thanks for the link, the library is the easy way :-)

It's true that the comments say it hangs in some cases.

As far as I understand, asynchronous downloading for one copy of an indicator is impossible, I should wait for it to successively retrieve the whole queue for each symbol?

The library does not freeze

downloading the history is only possible in Expert Advisors, the Help says that it cannot be used in indicators

indicators, again, examples in KB or in the articles, search for multisymbol or multicurrency

 

There are interesting things in Mql4. Here is an example. Suppose there is a function.

ArrayResize()

It has int type but it can be called as a (void) procedural function without returning a value? It's interesting.

 

Hello. Can you please advise how to fix it?

On the demo, the Expert Advisor does not open all orders, gives error 129 (wrong price), although I have specified Ask/Bid in OrderSend, slippage is with reserve. I noticed that when I delete the Expert Advisor, the terminal hangs for 10 seconds and displays in the log

In the tester, there are no errors or hiccups

Files:
 
Igor Makanu:

the library does not freeze

downloading history is only possible in Expert Advisors, the help file says not to use in indicators

indicators, again, examples in KB or in articles, search multisymbol or multicurrency


Here the author has put array initialisation in a separate library, what's the point?

Функции для инициализации массивов расположим в подключаемом файле InitArrays.mqh
 
psyman:


The author has put array initialization in a separate library, what is the point of that?

I do not know, the article is from 2013, maybe earlier it was necessary to do as the author of the article, the example from KB (it is also in the help) works in EAs and scripts without problems, I use it myself - I have not noticed any problems

If I need to write an indicator that will receive data from another timeframe or symbol, I will find it in the examples of the author

 
Here's a question. I received 200 bars in my chart. iBars() returned 200 (201 bars if I don't consider 0), I deleted 5 bars from the right side of archive andthe bars number was 195 (iBars() returned 195 bars), the chart became shorter and then I enabled connection and these 5 bars appeared in the chart and in the quotes archive. I noticed that when I do that it increments the number of bars one by one and does not load 5 at once, it's very strange, if I skip a very large section it will count one bar at a time, so I have to do lefty checks. How does the iBars() function work, does it return all bars at once when there is a connection or does it work in some other way?
 
Seric29:
Here's a question. I received 200 bars in my chart. iBars() returned 200 (201 bars if I don't consider 0), I deleted 5 bars from the right side of archive and the bars number was 195 (iBars() returned 195 bars), the chart became shorter and then I enabled connection and these 5 bars appeared in the chart and in the quotes archive. I noticed that when I do that it increments the number of bars one by one and does not load 5 at once, it's very strange, if I skip a very large section it will count one bar at a time, so I have to do lefty checks. How does the iBars() function work, does it return all bars at once when there is a connection or does it work in some other way?

It incrementally fetches the missing data until the whole environment is fully synchronized. As soon as one bar is fully loaded, the value of the number of bars has increased. You will not immediately get back the number of bars you have missing - only the number of fully synchronized data will be returned.

 
Artyom Trishkin:

There is a gradual loading of the missing data until the whole environment is fully synchronised. As soon as one bar has been fully loaded, the number of bars is incremented. You will not immediately get back the number of bars you have missing - only the number of fully synchronized data will be returned.

I see, I'm just calculating for sharp bar feeds, I thought that it works one-to-one: for example, 5 bars are missing, you turn on the network, it loads data and spends as much time as necessary, and then theiBars() function returns the number of bars with a possible difference of more than one. So, the developers have planned to feed the bars one by one, which simplifies writing the code but in case of large missed sections it will create unnecessary work for the robot. So in all cases whatever happens it will be loading bars one by one, 195, 196, 197, 198, 199, 200. Is this mechanism reliable or it may hang or something may happen that instead of loading one segment at a time it will load the whole segment?

Reason: