Tester Options for Loading History for Other Symbols

 

Currently I'm using something like this:

//~~~~~~~~~~Init-Function:
int init(){
    //~~~~~~~~~~Load History For Bars:
    iCustom("EURUSD",0,"Dummy_Indicator",0,1);
    iCustom("GBPUSD",0,"Dummy_Indicator",0,1);
    iCustom("AUDUSD",0,"Dummy_Indicator",0,1);
    iCustom("USDJPY",0,"Dummy_Indicator",0,1);
    iCustom("USDCHF",0,"Dummy_Indicator",0,1);
    iCustom("USDCAD",0,"Dummy_Indicator",0,1);
    //~~~~~~~~~~
return(0);}
So why do I need to load Indicator I don't intend to use. Tho, the indicator is removed later by the log. I'm wondering if there's a more direct option for loading history bars for different Symbols.
 

I assume you are talking about making sure the history is up to date ?

I do this, it's not very elegant but it seems to work, you can easily adapt it for other pairs . . .

 // Check for current data, try to get Open of bar 1 for a few time periods . . .
   
   TestBar1Price = iOpen(NULL, PERIOD_M1, 1); TestBar1Price = iOpen(NULL, PERIOD_M1, 2); TestBar1Price = iOpen(NULL, PERIOD_M1, 3); 
   TestBar1Price = iOpen(NULL, PERIOD_M5, 1); TestBar1Price = iOpen(NULL, PERIOD_M15, 1); TestBar1Price = iOpen(NULL, PERIOD_M30, 1); 
   TestBar1Price = iOpen(NULL, PERIOD_H1, 1); TestBar1Price = iOpen(NULL, PERIOD_H4, 1); TestBar1Price = iOpen(NULL, PERIOD_D1, 1); 
   TestBar1Price = iOpen(NULL, PERIOD_W1, 1); TestBar1Price = iOpen(NULL, PERIOD_MN1, 1);  

   if (GetLastError() == 4066) 
      {
      Print("Error 4066, Requested history data in updating state", " Bars = ", Bars, " lMax_Bars_Indicator= ", lMax_Bars_Indicator);
      RestartBarPaint = true;
      return(0);
      }  
Reason: