PLEASE HELP ME WITH MY NEW DEVELOPED INDICATOR

 
THE ARROW REFUSED TO SHOW BY IT SELF , UNTIL I SWITCH TIME FRAME , THAT IS , IF AM ON 5MUNTE TIME FRAME ,I WILL CHANGE TO ANOTHER TIME 
FRAME AND SWITCH IT BACK TO 5MUNITE TIME FRAME BEFORE THE NEW ARROW APPEAR . PLEASE HELP ME OUT 


//+------------------------------------------------------------------+
//|                                                      BINARY .mq4 |
//|                                        Copyright 2015,YOUNGHADIZ |
//|                                        https://www.webthread.com |
//+------------------------------------------------------------------+
#property copyright "YOUNGHADIZ"
#property link      "https://www.webthread.com"
#property version   "  V1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White

double CrossUp[];
double CrossDown[];
extern string EMAIL=false;
 int FasterMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int FasterMA =   1;
 int SlowerMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int SlowerMA =   2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start() {
           
             
        
   int limit, i, counter;
   double fasterMAnow, slowerMAnnow, fasterMAprevous, slowerMAprevous, fasterMAafte, slowerMAafter;
   double Range, AvgRange;
   int counted_bars=IndicaCounted();
//---- check for possible errors
   if(counted_bars<1) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;
   
   for(i = 0; i <= limit; i++) {
   
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-High[counter]);
      }
      Range=AvgRange/10;
       
      fasterMAnow = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i);
      fasterMAprevious = iMA(NULL, 0, FastMA, 0, FasterMode, PRICE_CLOSE, i+1);
      fasterMAafter = iMA(NULL, 0, FasterMA, 0, FastMode, PRICE_CLOSE, i-2);

      slowerMAnow = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i);
      slowerMAprevious = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i+0);
      slowerMAafter = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i-1);
      
      if ((fasterMAnow<slowerMAnow) && (fasterMAprevious < slowerMAprevious) && (fasterMAafter > slowerMAafter)) {
         CrossUp[i] = High[i] - Range*0.5;
      }
      else if ((fasterMAnow<sloweMAnow) && (fasterMAprevious > slowerMAprevious) && (fasterMAafter < slowerMAafter)) {
         CrossDown[i] = Low[i] + Range*0.5;
      }
   }
   return(0);

}
 
please help out , the arrow doesnt come up in real life ,until i refresh the time frame
 
double alertTag;


alertTag = Time[0];

the alertTag  variable, it should be of datetime type.

datetime alertTag;
 
Marco vd Heijden:

the alertTag  variable, it should be of datetime type.

have removed all the alert from it but the arrow is still performing the same problem
//+------------------------------------------------------------------+
//|                                                      BINARY .mq4 |
//|                                        Copyright 2015,YOUNGHADIZ |
//|                                        https://www.webthread.com |
//+------------------------------------------------------------------+
#property copyright "YOUNGHADIZ"
#property link      "https://www.webthread.com"
#property version   "  V1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White

double CrossUp[];
double CrossDown[];
extern string EMAIL=false;
 int FasterMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int FasterMA =   1;
 int SlowerMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int SlowerMA =   2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start() {
           
             
        
   int limit, i, counter;
   double fasterMAnow, slowerMAnnow, fasterMAprevous, slowerMAprevous, fasterMAafte, slowerMAafter;
   double Range, AvgRange;
   int counted_bars=IndicaCounted();
//---- check for possible errors
   if(counted_bars<1) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;
   
   for(i = 0; i <= limit; i++) {
   
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-High[counter]);
      }
      Range=AvgRange/10;
       
      fasterMAnow = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i);
      fasterMAprevious = iMA(NULL, 0, FastMA, 0, FasterMode, PRICE_CLOSE, i+1);
      fasterMAafter = iMA(NULL, 0, FasterMA, 0, FastMode, PRICE_CLOSE, i-2);

      slowerMAnow = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i);
      slowerMAprevious = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i+0);
      slowerMAafter = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i-1);
      
      if ((fasterMAnow<slowerMAnow) && (fasterMAprevious < slowerMAprevious) && (fasterMAafter > slowerMAafter)) {
         CrossUp[i] = High[i] - Range*0.5;
      }
      else if ((fasterMAnow<sloweMAnow) && (fasterMAprevious > slowerMAprevious) && (fasterMAafter < slowerMAafter)) {
         CrossDown[i] = Low[i] + Range*0.5;
      }
   }
   return(0);

}
 
I tried it and it seems to be working i did not have to switch time frames.
 
younghadiz:
have removed all the alert from it but the arrow is still performing the same problem
Please I need your response .
 
Marco vd Heijden:
I tried it and it seems to be working i did not have to switch time frames.
Sir, the arrow doest come up in real life when new signal gereate until I refresh or switch time frame.



Or u can help me with ur updated code sir. To see my mistake
 
   for(i = 0; i <= limit; i++) {
   
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
      }
    }
I am sorry but i can not decode the used logic.
 
Marco vd Heijden:
I am sorry but i can not decode the used logic.


IT NOW WORKING PERFECTLY NOW SIR, BUT I DONT WANT IT TO BE GIVEN ALERT IN EVERY TICK. 
THANKS FOR YOUR SUPPORT SIR.

//+------------------------------------------------------------------+
//|                                                      BINARY .mq4 |
//|                                        Copyright 2015,YOUNGHADIZ |
//|                                        https://www.webthread.com |
//+------------------------------------------------------------------+
#property copyright "YOUNGHADIZ"
#property link      "https://www.webthread.com"
#property version   "  V1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White

double CrossUp[];
double CrossDown[];
extern string EMAIL=false;
 int FasterMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int FasterMA =   1;
 int SlowerMode = 1; //0=sma, 1=ema, 2=smma, 3=lwma
 int SlowerMA =   2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+

int init()
  {
//---- indicators
   SetIndexStyle(0, DRAW_ARROW, EMPTY);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, CrossUp);
   SetIndexStyle(1, DRAW_ARROW, EMPTY);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, CrossDown);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start() {
           
             
        
   int limit, i, counter;
   double fasterMAnow, slowerMAnnow, fasterMAprevous, slowerMAprevous, fasterMAafte, slowerMAafter;
   double Range, AvgRange;
   int counted_bars=IndicaCounted();
//---- check for possible errors
   if(counted_bars<1) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;
   
   for(i = 0; i <= limit; i++) {
   
      counter=i;
      Range=0;
      AvgRange=0;
      for (counter=i ;counter<=i+9;counter++)
      {
         AvgRange=AvgRange+MathAbs(High[counter]-High[counter]);
      }
      Range=AvgRange/10;
       
      fasterMAnow = iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i);
      fasterMAprevious = iMA(NULL, 0, FastMA, 0, FasterMode, PRICE_CLOSE, i+1);
      fasterMAafter = iMA(NULL, 0, FasterMA, 0, FastMode, PRICE_CLOSE, i-2);

      slowerMAnow = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i);
      slowerMAprevious = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i+0);
      slowerMAafter = iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i-1);
      
      if ((fasterMAnow<slowerMAnow) && (fasterMAprevious < slowerMAprevious) && (fasterMAafter > slowerMAafter)) {
         CrossUp[i] = High[i] - Range*0.5;
      }
      else if ((fasterMAnow<sloweMAnow) && (fasterMAprevious > slowerMAprevious) && (fasterMAafter < slowerMAafter)) {
         CrossDown[i] = Low[i] + Range*0.5;
      }
   }
   return(0);

}
 
please i need your response
 
I do not see any Alerts in your code.
Reason: