Download MetaTrader 5

How to download data of symbol

To add comments, please log in or register
Michal Jurnik
24
Michal Jurnik  

Hi guys, I'm working on Indicator that use iClose function. It's not unknown problem that function return 0 when historical data are not loaded. I would like to know how to load these data for different symbols.

 

For example: I have my EURUSD chart opened and I've never opened USDCAD. I would add my indicator which need data from USDCAD. Is it possible to load these data? Thanks for reply!

whroeder1
14783
whroeder1  
Just_Mike: It's not unknown problem that function return 0 when historical data are not loaded. I would like to know how to load these data for different symbols.
It's automatic. When you get zero (the first time,) check the error code for ERR_HISTORY_WILL_UPDATED and wait 5 seconds and retry. See ArrayCopyRates - MQL4 Documentation Returned value and the example it links to in ArrayCopySeries - MQL4 Documentation
Michal Jurnik
24
Michal Jurnik  
I can't use Sleep() function for indicator but thanks for reply.
whroeder1
14783
whroeder1  
Just_Mike: I can't use Sleep() function for indicator but thanks for reply.
Of course not. You'll have to have it remember that it needs to redo all bars (not just IndicatorCounted) the next tick after 5 seconds.
To add comments, please log in or register