left parenthesis expected

 

Normally this is just a syntax error, but i cant find any missing brackets or end of line stuff.. help?

the 2 errors:

'!=' - left parenthesis expected (52, 13)

';' - left parenthesis expected (54, 21)

the code :

int hours[];
int weeks[];
int months[];
double lastTick = 0;
int hourCount = 0;
int hour=0;
int handle;
string datafile = "CCI.txt";
int i = 1;
double avgnum;
double lastnum;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   lastTick = iCustom(NULL, 0, "CCI",-20,20,0,0);
   hours[1] = lastTick;
   hours[2] = lastTick;
   hours[3] = lastTick;
   hours[4] = lastTick;
   hours[5] = lastTick;
   hours[6] = lastTick;
   hours[7] = lastTick;
   hours[8] = lastTick;
   hours[9] = lastTick;
   hours[10] = lastTick;
   hours[11] = lastTick;
   hours[12] = lastTick;
//----
   return(0);
  }


//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   if (Hour != hour)
      {
         hour = Hour;
         hourCount = hourCount+1;
         hours[hourCount] = iCustom(NULL, 0, "CCI",-20,20,0,0);
          
          while (i<13)
            {
               lastnum = hours[i] + lastnum ;
               i++;
            }

            avgnum=lastnum/12;
            i=1;     
       
      
      if (hourCount == 12)
      {
         hourCount = 0;
      }
      
      handle = FileOpen(datafile,FILE_CSV|FILE_READ|FILE_WRITE,';');
   FileSeek(handle, 0, SEEK_END);
   FileWrite(handle,avgnum);
      FileClose(handle);
      

      
    }
      

   return(0);
  }

thank you in advance.
 
nickblack:

Normally this is just a syntax error, but i cant find any missing brackets or end of line stuff.. help?

the 2 errors:

'!=' - left parenthesis expected (52, 13)

';' - left parenthesis expected (54, 21)

the code :

thank you in advance.

Hi nickblack,

This is left parenthesis -->> (

This is right parenthesis -->> )

This is what the compiler expected before ; -->> ()

So ...

Hour ()

 
onewithzachy:

Hi nickblack,

This is left parenthesis -->> (

This is right parenthesis -->> )

This is what the compiler expected before ; -->> ()

So ...


herp derp >.< thank you, I cant believe I forgot that considering i've done that before.

thank you!

and many cookies to you!

 
nickblack:

Normally this is just a syntax error, but i cant find any missing brackets or end of line stuff.. help?

the 2 errors:

'!=' - left parenthesis expected (52, 13)

';' - left parenthesis expected (54, 21)

the code :

thank you in advance.

You should use a function with ().
 
@nickblack:
 double hour;
 
 if (Hour()!=hour) { }
Thank you. :)