Problem with "{}" help please!

 

input int media1;
input int media2;
input int hora;
bool st=false;
string mns="-----";
void OnTick(){
Comment ("Message:",mss);

if (Hour()==hora){

st=true;
mss="AUTORIZADO!"   
}
if (st==true){


if (iMA(NULL,0,media1,0,MODE_EMA,PRICE_CLOSE,0)) < (iMA(NULL,0,media2,0,MODE_EMA,PRICE_CLOSE,0)){

mss="Waiting to buy!"

}else{

mns="Waiting to sell!"
}

}


Hello, this is my code and I don't know where is the problem with it. MQL4 shows me two problems unbalanced parentheses and unexpected end of program.

 
input int media1;
input int media2;
input int hora;
bool st=false;
string mns="-----", mss;
void OnTick()
  {

   if(Hour()==hora)
     {

      st=true;
      mss="AUTORIZADO!";
     }
   if(st==true)
     {


      if(iMA(NULL,0,media1,0,MODE_EMA,PRICE_CLOSE,0) < (iMA(NULL,0,media2,0,MODE_EMA,PRICE_CLOSE,0)))
        {

         mss="Waiting to buy!";

        }
      else
        {

         mns="Waiting to sell!";
        }
     }
   Comment("Message:",mss);
  }
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. You are missing semicolons at the end of your statements. @Pavel Shutovskiy has corrected that.
 
Thank you very much!
Reason: