How to check if indicator is loaded more than once_

 

Hi,

how can i check in mql4 code, if indicator is loaded twice?

BR, Mamboki

 

For example, as follows

int OnInit()
{
   //--- 
   string get_name;
   int count = 0;

   for (int i = 0; i < ChartIndicatorsTotal(0, 0); i++)
   {
      get_name = ChartIndicatorName(0, 0, i);
      if (get_name == "Indicator")
         count += 1;
   }

   if (count >= 2)
      Alert ("Two Indicators are found");
   //---
   return(INIT_SUCCEEDED);
}
Reason: