Difference between Ea and Indicator

 

Hello,

I am new to MT4 and MQL4. I tried to run an EA as an Indicator and I receive the message "2013.01.28 19:14:56 Expert 'AAAA' is not custom indicator and will be removed". My question is how can be distinguished in code between the two ? At the first look I see no difference in coding.... out of author's comment: "this is an indicator/expert advisor".

Thanks in advance! 

 
Do you see any of these?
You don't do you? Then it is NOT an indicator.
 
WHRoeder:
Do you see any of these?

The code is from documentation:

//--------------------------------------------------------------------
// newbar.mq4  
// Ïðåäíàçíà÷åí äëÿ èñïîëüçîâàíèÿ â êà÷åñòâå ïðèìåðà â ó÷åáíèêå MQL4.
//--------------------------------------------------------------------
extern int Quant_Bars=15;                       // Êîëè÷åñòâî áàðîâ
bool New_Bar=false;                             // Ôëàã íîâîãî áàðà
//--------------------------------------------------------------------
int start()                                     // Ñïåö. ôóíêöèÿ start
  {
   double Minimum,                              // Ìèíèìàëüíàÿ öåíà
          Maximum;                              // Ìàêñèìàëüíàÿ öåíà
//--------------------------------------------------------------------
   Fun_New_Bar();                               // Îáðàùåíèå ê ô-èè
   if (New_Bar==false)                          // Åñëè áàð íå íîâûé..
      return;                                   // ..òî óõîäèì
//--------------------------------------------------------------------
   int Ind_max =ArrayMaximum(High,Quant_Bars,1);// Èíäåêñ áàðà ìàêñ.ö. 
   int Ind_min =ArrayMinimum(Low, Quant_Bars,1);// Èíäåêñ áàðà ìèí. ö. 
   Maximum=High[Ind_max];                       // Èñêîìàÿ ìàêñ öåíà
   Minimum=Low[Ind_min];                        // Èñêîìàÿ ìèí. öåíà
   Alert("Çà ïîñëåäíèå ",Quant_Bars,            // Âûâîä íà ýêðàí  
   " áàðîâ Min= ",Minimum," Max= ",Maximum);
   return;                                      // Âûõîä èç start()
  }
//--------------------------------------------------------------------
void Fun_New_Bar()                              // Ô-èÿ îáíàðóæåíèÿ ..
  {                                             // .. íîâîãî áàðà
   static datetime New_Time=0;                  // Âðåìÿ òåêóùåãî áàðà
   New_Bar=false;                               // Íîâîãî áàðà íåò
   if(New_Time!=Time[0])                        // Ñðàâíèâàåì âðåìÿ
     {
      New_Time=Time[0];                         // Òåïåðü âðåìÿ òàêîå
      New_Bar=true;                             // Ïîéìàëñÿ íîâûé áàð
     }
  }