Expert is not custom indicator?????

 

I am getting the "Expert is not custom indicator" error when attaching the EA to a chart? ANy ideas why?


#property indicator_buffers 2

//---- indicator buffers
double ExtMA10Buffer[];
double ExtMA80Buffer[];
datetime TouchLipsFlagUpdate = 0;

//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}

int Crossed (double line1 , double line2)
{
static int last_direction = 0;
static int current_direction = 0;
if(line1>line2)current_direction = 1; //up
if(line1<line2)current_direction = 2; //down
if(current_direction != last_direction) //changed
{
last_direction = current_direction;
return (last_direction);
}
else
{
return (0);
}
}

int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- main loop
   for(int i=0; i<limit; i++)
     {
      //---- ma_shift set to 0 because SetIndexShift called abowe
      ExtMA10Buffer[i]=iMA(NULL,0,10,0,MODE_SMMA,PRICE_MEDIAN,i);
      ExtMA80Buffer[i]=iMA(NULL,0,80,0,MODE_SMMA,PRICE_MEDIAN,i);
     }

//alues
Comment("MA10: ",DoubleToStr(iMA(NULL,0,10,0,MODE_SMMA,PRICE_MEDIAN,i),5) +
"\MA80: ",DoubleToStr(iMA(NULL,0,80,0,MODE_SMMA,PRICE_MEDIAN,i),5) 
);

//Crossover
if(TimeCurrent()-TouchLipsFlagUpdate>=86400) {
   int isCrossed = Crossed (iMA(NULL,0,10,0,MODE_SMMA,PRICE_MEDIAN,i),iMA(NULL,0,80,0,MODE_SMMA,PRICE_MEDIAN,i));
   if (isCrossed!=0) {
                        Alert(Symbol() + "MA cross");
                        TouchLipsFlagUpdate = TimeCurrent();
                     }
}

    
//---- done
   return(0);
  }
//+------------------------------------------------------------------+
 
SanMiguel:

I am getting the "Expert is not custom indicator" error when attaching the EA to a chart? ANy ideas why?


For "Expert is not custom indicator". :))

It is an indicator, not an EA.

 
ggekko:

For "Expert is not custom indicator". :))

It is an indicator, not an EA.

I opened and saved it as an indicator. It won't attach to the chart????

 
SanMiguel:

I opened and saved it as an indicator. It won't attach to the chart????

Doesn't indicator code need either #property indicator_chart_window or #property indicator_separate_window ?