WHY ? Trouble with custom indicators

 
Hi

I have 2 buffers exactly the same except one is LOWER_MODE and the other is UPPER_MODE

Alow() works fine while Bhigh() creates Meta Editor errors


'B' - some operator expected    ABCDtrade.mq4    116    7
expression has no effect    ABCDtrade.mq4    116    11
possible use of uninitialized variable 'B'    ABCDtrade.mq4    117    10
1 error(s), 2 warning(s)        2    3


//+------------------------------------------------------------------+
//| 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(Alow()!=0)Alow();
  
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+


double Alow()
{
   int i;
   double A;
   double fraclow=iFractals(NULL, 0, MODE_LOWER,3);
   
   for (i=0; fraclow == 0; i++)
      {
      fraclow = iFractals(NULL,0,MODE_LOWER,i);
      A=fraclow;
      if(A!=0)
      return(frlow1[i]=A);     
      }
      
return(0);          
}


double Bhigh()
{
   int i;
   double B;
   double frachigh=iFractals(NULL, 0, MODE_UPPER,3);
   //double faster=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);//MODE_MAIN
   //double slower=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1); //MODE_SIGNAL
   
   for (i=0; frachigh == 0; i++)
      {
      frachigh = iFractals(NULL,0,MODE_UPPER,i)
      B = frachigh;
      if(B!=0)
      return(frhigh1[i]=B);
      }
           
return(0);     
}
Both the same as far as i can tell, so why Bhigh() errors ?
 
      frachigh = iFractals(NULL,0,MODE_UPPER,i);
 
angevoyageur:

HA HA,  oh crap

Thanks

Reason: