is there any difference between using MqlRates and using iCLose for example ?
MqlRates i have to use array and copy rates to the array , where iClose can just enter the shift number of the bar and thats it
or i am missing something here ?
thanks
iXXX functions (including iClose) are best avoided. Such functions contain a call to the CopyXXX functions inside (CopySeries, roughly speaking). When using iXXX functions, you must check the result of execution and the error flag each time such a function is called.
Therefore, just use CopySeries to copy the amount of data you need 1 time. Check the result of the execution once and use the ready-made copied data.
Note
The function always returns actual data. For this purpose it performs a request to the timeseries for the specified symbol/period during each call.
Machine translate:
Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий
Ilyas, 2023.03.05 09:42
CopyRates has no synchronization problems, and CopySeries is a special case of CopyRates, when you need to get not all the data for a bar, but only individual fields.
If the required bar fields are copied by separate calls to CopyLow, СopyTime, etc., then a new bar may open between calls and the data in the arrays will be inconsistent, as described by Alain
CopySeries is a completely standalone function and does not use CopyRates for its work.
Synchronization is ensured by blocking data updates by symbol for the duration of the function, as in all other CopyXXX
An update lock means that symbol updates will be applied after the lock is released, i.e. they will not be lost.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
is there any difference between using MqlRates and using iCLose for example ?
MqlRates i have to use array and copy rates to the array , where iClose can just enter the shift number of the bar and thats it
or i am missing something here ?
thanks