Download MetaTrader 5

Help open parenthesis expected

To add comments, please log in or register
lion999
40
lion999  

I have no knowledge of coding yet while compiling an ea i managed to reduce the 15 errors to just 2, both are the same  ''   'if' - open parenthesis expected    ''  and when i click on this error it leads me to this point in the code which i cannot rectify      

  void tick22()
 {if {tick22==true} {

and the cusor is just after the curly bracket before if

i changed this code " {if (tick22==true) { "  to the above " {if {tick22==true} { " and reduced 15 errors to 2 errors

can anyone help me please  

phi nuts
2180
phi nuts  
lion999:

I have no knowledge of coding yet while compiling an ea i managed to reduce the 15 errors to just 2, both are the same  ''   'if' - open parenthesis expected    ''  and when i click on this error it leads me to this point in the code which i cannot rectify      

  void tick22()
 {if {tick22==true} {

and the cusor is just after the curly bracket before if

i changed this code " {if (tick22==true) { "  to the above " {if {tick22==true} { " and reduced 15 errors to 2 errors

can anyone help me please  

 

Next time use SRC button to post the code

 

do this

 void tick22()
 {
  if (tick22==true) 
    {

    }
 }

Be careful when writing parenthesis { and } with ( and ).

Hope you have define tick22 variable before coz if not you will have more error though .

 

lion999
40
lion999  

Thanks very much phi.nuts, .......  for the reply
Grigorv
6
Grigorv  

Can anyone help me figure out how to fix this last error, I am having some complications figuring it out?

Expert Advisor Help

whroeder1
17940
whroeder1  
Grigorv: Can anyone help me figure out how to fix this last error, I am having some complications figuring it out?
  1. Please don't post image, of code. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. Your code is
    if {myAccountEquity - myAccountBalance) > 10 
      (
        CloseAllOrders();
      )
    Look at the documentation.
              Conditional Operator if-else - Operators - Language Basics - MQL4 Reference
    The if statement form is if ( condition ) statement; or if ( condition ) { controlled; statements; }. Your code doesn't have an open parenthesis (per the error message.) It has an open brace.
              Correct brackets/bracers {} - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 2

  3. You have a closing parenthesis without an open
  4. You have no closing parenthesis after the end of your condition.
  5. You have no braces for your controlled statements.
Grigorv
6
Grigorv  
whroeder1:
  1. Please don't post image, of code. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. Your code isLook at the documentation.
              Conditional Operator if-else - Operators - Language Basics - MQL4 Reference
    The if statement form is if ( condition ) statement; or if ( condition ) { controlled; statements; }. Your code doesn't have an open parenthesis (per the error message.) It has an open brace.
              Correct brackets/bracers {} - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 2

  3. You have a closing parenthesis without an open
  4. You have no closing parenthesis after the end of your condition.
  5. You have no braces for your controlled statements.
I followed the steps and, here is what it says-
whroeder1
17940
whroeder1  
Grigorv: ok I did exactly what you described and this is what it says-
No you didn't.
  1. What part of "Please don't post image of code" was unclear?

  2. What part of "if ( condition ) { controlled; statements; }" was unclear?
    if   { myAccountEquitey - myAccountBalance) > 10)}
    
       (
         CloseAllOrders();
       )
  3. What part of "You have a closing parenthesis without an open" was unclear?
Grigorv
6
Grigorv  
whroeder1:
No you didn't.
  1. What part of "Please don't post image of code" was unclear?

  2. What part of "if ( condition ) { controlled; statements; }" was unclear?
  3. What part of "You have a closing parenthesis without an open" was unclear?
Files:
Grigorv
6
Grigorv  
whroeder1:
No you didn't.
  1. What part of "Please don't post image of code" was unclear?

  2. What part of "if ( condition ) { controlled; statements; }" was unclear?
  3. What part of "You have a closing parenthesis without an open" was unclear?

if {(myAccountEquity - myAccountBalance) >[5])}

    (

      CloseAllOrders ()

    )

whroeder1
17940
whroeder1  

I asked you to use code button twice. Ignored three times (two images and one text.)

I showed you the difference between parentheses () and braces {} but you refuse to look, read, and learn.

Go to freelance and pay someone. I doubt anyone here can help you.

To add comments, please log in or register