'}' - semicolon expected

 

I was practicing to make a simple E.A.but the following errors occurs .

"        '}' - semicolon expected                             "

"        'else' - illegal 'else' without matching 'if'       " 

Can anyone please point out my mistake in the following program  and make the correction.


#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict

extern int period = 14;


void OnTick()
{
   bool bill;
   bill = rsi();
    if (bill == true)
   {
    OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask+20*Point,Ask-30*Point,NULL,0,0)
   }
  
    else if(bill == false)
   { 
        OrderSend(Symbol(),OP_SELL,0.1,Bid,Bid-20*Point,Ask+30*Point,Null,0,0)
   }
   else
   {
   Alert("there is something wrong");
   }
 
 
}

bool rsi()
{
double point;

point =  iRSI(Symbol(),0,period,PRICE_TYPICAL,0);
if(point>60)
return(true);
else if(point<30)
return(false);
else
return(EMPTY_VALUE);
}
 
  • Please use the "SRC" button to submit code samples!
  • You are missing ";" terminators on the OrderSend lines.
  • You are missing the slippage parameter on your 2nd OrderSend.
  • Don't use "if (bill == true)". Just use "if(bill)" or "if(!bill)" because it is already a Boolean.
  • Boolean values only have two states, true or false. There is no third state as is implemented in your code "if(bill == true) ... else if(bill == false) ... else ..."
  • Always check the results of the "OrderSend" and other such functions.
  • There is no predefined "Null". It is case sensitive, so use "NULL".
  • There are several other mistakes, but start with these.