Download MetaTrader 5
To add comments, please log in or register
MQL5 Cloud Network is a distributed computing network. Just give it a try!
Michal Jurnik
24
Michal Jurnik 2014.12.01 15:34 

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
13593
whroeder1 2014.12.01 15:59  
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 2014.12.02 06:38  
I can't use Sleep() function for indicator but thanks for reply.
whroeder1
13593
whroeder1 2014.12.02 15:15  
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