Problem with "{}" help please!

To add comments, please log in or register
yMaivil
14
yMaivil  

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.

Pavel Shutovskiy
47012
Pavel Shutovskiy  
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);
  }
William Roeder
20210
William Roeder  
  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.
yMaivil
14
yMaivil  
Thank you very much!
To add comments, please log in or register