Индикатор не показывает сигналы на текущем баре.

 

Здравствуйте. Есть стрелочный индикатор, хочу отфильтровать его по МА. Запускаю в тестере, нет сигналов. Когда, после теста компилирую код, на графике, в тестере появляются сигналы.

В чём ошибка? 

#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots   2
//--- plot UP
#property indicator_label1  "UP"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrLawnGreen
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- plot DN
#property indicator_label2  "DN"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrDeepPink
#property indicator_style2  STYLE_SOLID
#property indicator_width2  1

//--- enums
enum enumYN
  {
   enYes=1, // Да
   enNo=0,  // Нет
  };

input
enumYN Alert_=enYes; //    
input
enumYN Sound_=enNo;   //      
input
enumYN Mail=enYes;   //      
input
enumYN Push=enNo;   

//--- indicator buffers
double         BufferUP[];
double         BufferDN[];
datetime tim;

int dist=3;
string nameInd;
double LINSELL,ARSELL,LINBUY,ARBUY,MA;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,BufferUP);
   SetIndexBuffer(1,BufferDN);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   SetIndexArrow(0,233);
   SetIndexArrow(1,234);
//---
//---
   
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if(rates_total<2) return(0);
     {
      int limit=rates_total-prev_calculated;
      if(limit>1) 
        {
         limit=rates_total-2;
         ArrayInitialize(BufferUP,EMPTY_VALUE);
         ArrayInitialize(BufferDN,EMPTY_VALUE);
        }
      for(int i=limit; i>=0; i--) 
        {
          ARBUY=NormalizeDouble(iCustom(NULL,0,"ComboTrend",0,i),Digits);

          ARSELL=NormalizeDouble(iCustom(NULL,0,"ComboTrend",1,i),Digits);
         
           MA=iMA(NULL,0,133,0,MODE_SMMA,PRICE_CLOSE,i);;

         if(ARBUY!=EMPTY_VALUE&&ARBUY>MA)
           {
            BufferUP[i]=low[i]-dist*Point;
            if(tim!=Time[0])
              {
               AlertArrow(Symbol()+" "+Period()+" "+nameInd+" UP",1);
               tim=Time[0];
              }

           }

         if(ARSELL!=EMPTY_VALUE&&ARSELL<MA)
           {
            BufferDN[i]=high[i]+dist*Point;
            if(tim!=Time[0])
              {
               AlertArrow(Symbol()+" "+Period()+" "+nameInd+" DN",2);//
               tim=Time[0];
              }

           }

         Comment(""
                 );
        }
      //--- return value of prev_calculated for next call

     }
   return(rates_total);
  }
//+
void SetArrow(int cd,color cl,
              string nm="",datetime t1=0,double p1=0,int sz=3) 
  {
   if(nm=="") nm=DoubleToStr(Time[0],0);
   if(t1<=0) t1=Time[0];
   if(p1<=0) p1=Bid;
   nameInd=WindowExpertName();
   int wind=WindowFind(nameInd);
   if(wind==-1)wind=0;
   if(ObjectFind(nm)<0) ObjectCreate(nm,OBJ_ARROW,wind,0,0);
   ObjectSet(nm,OBJPROP_TIME1,t1);
   ObjectSet(nm,OBJPROP_PRICE1,p1);
   ObjectSet(nm,OBJPROP_ARROWCODE,cd);
   ObjectSet(nm,OBJPROP_COLOR,cl);
   ObjectSet(nm,OBJPROP_WIDTH,sz);
  }
void AlertArrow(string text="",int arrowdir=0)
  {
   nameInd=WindowExpertName();
   int wind=WindowFind(nameInd);
   if(wind==-1)wind=0;
   ObjectCreate("Originalalert",OBJ_LABEL,wind,0,0);
   ObjectSetText("Originalalert","",10,"",clrNONE);
   ObjectSet("Originalalert",OBJPROP_CORNER,2);
   ObjectSet("Originalalert",OBJPROP_XDISTANCE,200);
   ObjectSet("Originalalert",OBJPROP_YDISTANCE,10);

   if(Alert_) 
     {
      Alert(text);
      if(Sound_)PlaySound("alert.wav");
     }
// if(Arrow) if (arrowdir==1) SetArrow(241,Blue,nameInd+DoubleToStr(Time[shift_],0),Time[shift_],Low[shift_]);
//if(Arrow) if (arrowdir==2) SetArrow(242,Red,nameInd+DoubleToStr(Time[shift_],0),Time[shift_],High[shift_]);
   if(!IsTesting())if(Mail) SendMail(text,text);
   if(!IsTesting())if(Push) SendNotification(text);

  }
 
bij:

Здравствуйте. Есть стрелочный индикатор, хочу отфильтровать его по МА. Запускаю в тестере, нет сигналов. Когда, после теста компилирую код, на графике, в тестере появляются сигналы.

В чём ошибка? 

      if(ARBUY!=EMPTY_VALUE&&ARBUY>MA)

Вы сравниваете ARRBUY  и  MA.  Это скорость и средняя цена. Что даст результат такого сравнения? Это то же самое, что сравнивать температуру и вес!!!

Возможно ошибаюсь, т.к. не смог скачать индикатор ComboTrend

Причина обращения: