Download MetaTrader 5
To add comments, please log in or register
All activity of the MQL5.community members is displayed on a single page!
dhunay
9
dhunay 2016.04.15 03:24 

 Hey guys im getting the error message -

 check operator precedence for possible error; use parentheses to clarify precedence

 

FOR THE LINE

 

 if (!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name) continue;

 

can somebody tell me what im doing wrong as im new to coding.

 

Thanks In advance 

Ovo Cz
2951
Ovo Cz 2016.04.15 04:24  

The operator precedence in logical expressions has changed recently. Though this expression compiles, the compiler detected your expression is probably affected by the recent change. So include some parentheses to specify the precedence clearly.

And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.

whroeder1
13627
whroeder1 2016.04.15 13:32  
  1. This can be interpreted two different ways. Always use parentheses when mixing ands and ors.
    if (!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name) continue;
    
    if((!All_Trendline_Alert && ObjectName(li_28) != High_TL_Name)|| ObjectName(li_28) != Low_TL_Name) continue;
    
    if (!All_Trendline_Alert &&(ObjectName(li_28) != High_TL_Name || ObjectName(li_28) != Low_TL_Name))continue;

  2. Ovo: And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.
    Variables like Li_28 are a sign of decompiled (pre-build 600) code.

    Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also https://www.mql5.com/en/forum/134317

    If you post decompiled code again, you will likely be banned.

    Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?

    sakib134
    3
    sakib134 2016.06.09 14:25  

    same issue for me 

    For this line shows the warning "check operator precedence for possible error; use parentheses to clarify precedence"

    if (Ld_32 < 0.0 && Ld_44 > 0.0 && Ld_32 < 3.0 * ((-Ad_12) * Gd_352) || Ld_44 > 3.0 * (Ad_12 * Gd_352))

    Somebody please help me how to solve this.

    Thanks in advanced.. 

    Fernando Carreiro
    1502
    Fernando Carreiro 2016.06.09 14:32  
    sakib134:

    same issue for me 

    For this line shows the warning "check operator precedence for possible error; use parentheses to clarify precedence"

    if (Ld_32 < 0.0 && Ld_44 > 0.0 && Ld_32 < 3.0 * ((-Ad_12) * Gd_352) || Ld_44 > 3.0 * (Ad_12 * Gd_352))

    Somebody please help me how to solve this.

    Thanks in advanced.. 

    Were you too lazy to actually READ the 3 posts on this thread prior to your post?

    You are using decompiled (stolen code) and the title even gives you the answer to your problem - use parentheses to clarify precedence!

    Blahtech Limited
    2762
    James Cater 2016.06.10 13:16  
    WHRoeder:
    1. This can be interpreted two different ways. Always use parentheses when mixing ands and ors.
    2. Ovo: And an advice: using variable names like "li_28" is sign of piracy (stolen code), avoid them.
      Variables like Li_28 are a sign of decompiled (pre-build 600) code.

      Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property. Either way we will not be an accomplice after the fact to theft. See also https://www.mql5.com/en/forum/134317

      If you post decompiled code again, you will likely be banned.

      Don't tell us you found it on the 'net: if someone stole your bank details and uploaded them on to the internet, is it OK for everyone to use them because "someone uploaded it, I don't know why I can't use that"?

      Good to see the moderators taking a strong stance against this on the forum.

      It's a shame that the  MQL5 team seem to have a more lax attitude to dodgy vendors "fencing" decompiled and stolen products on the marketplace.

      /
      To add comments, please log in or register