ERR_TOO_FREQUENT_REQUESTS error does not correspond with ArrayCopyRates function - with trading operations only. You need to zeroed last_error variable before ArrayCopyRates function call. for 2 bars use
double two_rates[2][6] for(int i=0; i<2; i++) { two_rates[i][0]=iTime(Symbol(),Period(),i); two_rates[i][1]=iOpen(Symbol(),Period(),i); two_rates[i][2]=iLow(Symbol(),Period(),i); two_rates[i][3]=iHigh(Symbol(),Period(),i); two_rates[i][4]=iClose(Symbol(),Period(),i); two_rates[i][5]=iVolume(Symbol(),Period(),i); }
I need the most recent and previous bars from the 5 minute, 30 minute, 1 hour and 4 hour time frames from a given currency. Unless my research is incorrect the history files are only updated if you have the time frame a particular history file represents open. This is why I can not use the iTime, iOpen, iLow, iHigh or iClose fuctions. To elaborate further I would like to have only one time frame open and retrieve the two most recent bars from the 5 minute, 30 minute, 1 hour and 4 hour time frames of the given cross currency I have open without having to have all of the respective time frames open in seperate child windows. Can MT4 do this? I have a work around, but it is very time consuming coding it up.
what the problem?
check for iTime(needed_symbol,needed_period). if last error is 4066 then wait few seconds and call again (may be in the loop but error 4066 will not be repeated)
check for iTime(needed_symbol,needed_period). if last error is 4066 then wait few seconds and call again (may be in the loop but error 4066 will not be repeated)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Will calling the function ArrayCopyRates generate the above mentioned error or can I run a piece of code such as the following and the data vendor will not generate the above mentioned error? If an error will be generated how can I get the two bars from the time frames I am interested in sending to the DLL?