Due to the lack of multithreading when calculating indicators with a sufficiently large number of them, the terminal is hung up on one or two times. Especially when the calculation itself in the indicator is resource-intensive, which is why I decided to completely abandon the indicators and conduct all calculations directly in the expert Advisor.
But before counting the values of the indicator functions, it is necessary to get historical data on the necessary tools, so at the time of initialization of the expert Advisor, MqlRates structures are created for each symbol with which the indicator-function will later work to calculate.
I forcibly set the date from which to get the data, or rather the adviser before this date stupidly ignores everything. In toga, after receiving structures for ten instruments, I see that the number of data passed to the structure is different for each instrument. In General, it coincides, but no one has canceled the holes in history, so the actual question.
How to synchronize the receipt of structures through CopyRates so that the amount of data received in all structures is the same and they are synchronized with each other in time??? Roughly speaking, if I need to get 100 data from a symbol, and there are holes, then fill the hole stupidly with the previous value. Surprisingly, the POIs did not give anything sensible. But most of all, I was surprised that no one had any such questions. Maybe there are other approaches to such systems. Maybe not through the structure even, but I don’t know. In my opinion, it would be easiest to have array structures for other tools after initialization of the expert Advisor. However, this is not a problem, it is a different amount of copied data.
How to fill holes in the history when copying a structure using CopyRates. Fill the hole with the previous value. I thought to fill in the structure by bar, copying one element in a loop, for the entire structure, but in copyrates you need to specify the entire array, and if I use the same CopyRates to copy one element to a specific position of the receiver array, what then? I hope for Your responsiveness, and then I’m already zaaaaa.. alsya to be honest. Specifically for this case, nothing really in the literature did not meet anything.