ArrayCopyRates and the ERR_TOO_FREQUENT_REQUESTS error

 
I need to get the last two bars from multiple time frames (5min, 30min, 1hr and 4hr). I can only assume the constant ERR_TOO_FREQUENT_REQUESTS as being a possible return code from GetLastError actually means something to the data vendor. I need five of the six numbers (excepting volume) relating to the two bars I wish to retrieve. These numbers will be passed to a DLL which will process them.

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?

int start()
{
   double r5M[][6], r30M[][6], r1H[][6], r4H[][6];
   int trade = 0;

   ArrayCopyRates(r5M, Symbol(), PERIOD_M5);
   ArrayCopyRates(r30M, Symbol(), PERIOD_M30);
   ArrayCopyRates(r1H, Symbol(), PERIOD_1H);
   ArrayCopyRates(r4H, Symbol(), PERIOD_4H);
   trade = Abstract(Symbol(), r5M, r30M, r1H, r4H);

   switch(trade)
   {
      case 1:  Print("Sell at "+Close[0]+" @ "+TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS));
         break;
      case 2:  Print("Buy at "+Close[0]+" @ "+TimeToStr(CurTime(),TIME_DATE|TIME_SECONDS));
         break;
   }
   trade = 0;

   return(0);
}
 
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)
Reason: