Why am I getting a mass of errors on nested IF statements?

 

Right, why am I getting a mass of errors where there is no reason as to why said errors are present?

Getting really furious at the absolute stupidity of this,

error_log

Here is the code below:

if(BarTime != Time[0]){
   (   
 
      (
      
         (
         
            if(hammerHeadClose < hammerHeadOpen)
            if(bearHammerHead >= Transform(candleBodyLength,2))
            if((bearHammerHead / bearHammerHandle) <= hammerHandlePct)
            if((bearHammerHead / bullRetracementCandle) <= hammerHeadPct)
         
         )
         
         ||
         
         (
         
            if(hammerHeadClose > hammerHeadOpen)
            if(bullHammerHead >= Transform(candleBodyLength,2))
            if(bullHammerHead / (hammerHeadClose - iLow(Symbol(),0,1)) <= hammerHandlePct)
            if((bullHammerHead / bullRetracementCandle) <= hammerHeadPct)
            
         )
         
         
      )
      if(hammerHeadClose < hammerHeadOpen)
      if(bearHammerHead >= Transform(candleBodyLength,2))
      if((bearHammerHead / bearHammerHandle) <= hammerHandlePct)
      if((bearHammerHead / bullRetracementCandle) <= hammerHeadPct)
      if((initialTrendBearCandle / bullRetracementCandle) <= retracePercentage)
      if(bullRetracementCandle >= Transform(candleBodyLength,2))
      if(iMA(NULL,0,Period_TrendFast,0, AM_TrendFast,PRICE_CLOSE,1) < iMA(NULL,0,Period_TrendSlow,0,AM_TrendSlow,PRICE_CLOSE,1))
      if(iMA(NULL,0,Period_MomentumFast,0,AM_MomentumFast,PRICE_CLOSE,1) < iMA(NULL,0,Period_MomentumSlow,0,AM_MomentumSlow,PRICE_CLOSE,1))
      /*if(iClose(NULL,0,1) < iMA(NULL,0,maPeriod,0,MODE_SMA,PRICE_CLOSE,1))*/
      if(NewBar)
      if(spread <= MaxSpread)
      if(hourOfDay >= startingHour && hourOfDay < endingHour)
      if(OrdersTotal()== 0)
      if(InitTime)
   ){ .....Open Order.....;}
 
BCCI:Right, why am I getting a mass of errors where there is no reason as to why said errors are present? Getting really furious at the absolute stupidity of this,
  1. On the first line, you have an open brace "{" which means that all the following code is no longer part of the expression being tested.
    if(BarTime != Time[0]){
  2. Learn the difference between braces "{}" and brackets "()" and what they signify in MQL (a C/C++ like language).
  3. That is just very bad and "stringy" coding. You need to apply better discipline in your coding. Break things down and make your code easier to read and modify. Right now it is an absolute mess and nightmare.
  4. Use MetaEditor Styler to properly style your code and help you see where you are messing up.
PS! And if you are getting "furious at the absolute stupidity of this", remember that usually the problem lies between the chair and the computer.
     
    Fernando Carreiro:
    1. On the first line, you have an open brace "{" which means that all the following code is no longer part of the expression being tested.
    2. Learn the difference between braces "{}" and brackets "()" and what they signify in MQL (a C/C++ like language).
    3. That is just very bad and "stringy" coding. You need to apply better discipline in your coding. Break things down and make your code easier to read and modify. Right now it is an absolute mess and nightmare.
    4. Use MetaEditor Styler to properly style your code and help you see where you are messing up.
    PS! And if you are getting "furious at the absolute stupidity of this", remember that usually the problem lies between the chair and the computer2I will do.

    Wonderful, and I'm nowhere near the wiser. Do you want to carry on criticizing me or do you want to contribute something meaningful here? Let me know. Here's a hint, how about you rearrange the code I have placed on here. Just an idea...

     
    BCCI: Wonderful, and I'm nowhere near the wiser. Do you want to carry on criticizing me or do you want to contribute something meaningful here? Let me know. 

    I did contribute on several things to help you fix your code, but if you don't cool down you will have difficulty understanding them.

    I said, learn the differences between "braces" and "brackets". They have different meaning and function in the MQL language.

    I said break up your code into steps instead of lumping it all together as one long piece of stringy code.

    I said use the Styler so that you can visually see the levels and where all the braces and brackets are and how they are affecting your code logic.

    If you continue with your frustration, you will get nowhere. So please cool down, let your logical mind gain control again.

    Start with the "styler", that will already give you a jump start to see where most of the logic problems are as well as where the brackets and braces line up.

     

    Excuse me, my code is NOT stringy, it's NOT a horrendous mess, its segmented up, indented appropriately and broken down. If you don't like how I layout my code, close your eyes. It's people like you who make this a hostile place, telling me my code is a horrendous mess is not helpful, rearrange the code as appropriate and then maybe suggest a better way to rearrange my code as a footnote, don't start attacking me or you can do this community a favour and delete your account on here, because by your behaviour, that would be of no great loss to this community if you did something as noble and as selfless as that.

    Stop commenting further, step aside and allow someone who has not jumped out of the wrong side of the bed this morning. 

     
    BCCI: Wonderful, and I'm nowhere near the wiser. Do you want to carry on criticizing me or do you want to contribute something meaningful here? Let me know. Here's a hint, how about you rearrange the code I have placed on here. Just an idea...
    1. You wrote insane babble. He did his best to give you some help. You must learn.
                  if(hammerHeadClose < hammerHeadOpen)
                  if(bearHammerHead >= Transform(candleBodyLength,2))
                  if((bearHammerHead / bearHammerHandle) <= hammerHandlePct)
                  if((bearHammerHead / bullRetracementCandle) <= hammerHeadPct)

      The language is if, open parenthese, a boolean, close parenthese, a statement, terminating semicolon. You are missing the last two.

      If it doesn't compile, comment out sections and fix it until it does. PICNIC.

    2. We are not going to “rearrange” your code for you.
      1. MT4: Learn to code it.
        MT5: Begin learning to code it.

        If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

      2. or pay (Freelance) someone to code it. Top of every page is the link Freelance.
                  Hiring to write script - General - MQL5 programming forum 2019.08.21

      We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.

     
    BCCI:

    Excuse me, my code is NOT stringy, it's NOT a horrendous mess, its segmented up, indented appropriately and broken down. If you don't like how I layout my code, close your eyes. It's people like you who make this a hostile place, telling me my code is a horrendous mess is not helpful, rearrange the code as appropriate and then maybe suggest a better way to rearrange my code as a footnote, don't start attacking me or you can do this community a favour and delete your account on here, because by your behaviour, that would be of no great loss to this community if you did something as noble and as selfless as that.

    Stop commenting further, step aside and allow someone who has not jumped out of the wrong side of the bed this morning. 

    1. Your code is stringy. It is a horrendous mess. The problem is you. Learn the language. If you continue to berate those trying to help you, you will be ignored.
    2. No one attacked you. We are being honest with you. What you posted was insane garbage. It is you that is attacking.

    This is my fourty eight (48) years of experience as a software engineer opinion.

     
    BCCI:

    Excuse me, my code is NOT stringy, it's NOT a horrendous mess, its segmented up, indented appropriately and broken down. If you don't like how I layout my code, close your eyes. It's people like you who make this a hostile place, telling me my code is a horrendous mess is not helpful, rearrange the code as appropriate and then maybe suggest a better way to rearrange my code as a footnote, don't start attacking me or you can do this community a favour and delete your account on here, because by your behaviour, that would be of no great loss to this community if you did something as noble and as selfless as that.

    Stop commenting further, step aside and allow someone who has not jumped out of the wrong side of the bed this morning. 

    I will only say this once a then move on and away from your thread!

    I did not attack you nor criticize you as a person. I am not being hostile. I am offering you honest and useful opinions based on over 37 years of experienced as a software developer in many programing languages.

    If you choose to ignore the suggestions of someone much more knowledgeable and experienced in coding, than yourself, and choose to consider those suggestions and opinions rude on my part, then that is your prerogative.

    I wish all the best!

     
    William Roeder:
    1. You wrote insane babble. He did his best to give you some help. You must learn.

      The language is if, open parenthese, a boolean, close parenthese, a statement, terminating semicolon. You are missing the last two.

      If it doesn't compile, comment out sections and fix it until it does. PICNIC.

    2. We are not going to “rearrange” your code for you.
      1. MT4: Learn to code it.
        MT5: Begin learning to code it.

        If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

      2. or pay (Freelance) someone to code it. Top of every page is the link Freelance.
                  Hiring to write script - General - MQL5 programming forum 2019.08.21

      We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.

    Right 

    1) It is NOT "insane babble"
    2) He is in a mood, he needs to calm down and get off this forum
    3) I know exactly how to do code, I have been doing this for a long time and I have coded in this format before, with no issues, so why now?
    4) What's wrong with demonstrating suggestions? Its not like I'm asking you to rewrite the whole EA, THAT would be a paid freelance job,
    5) How am I missing the last two statements? The terminating semicolon is at the end of the "OrderSend" function and the statement's are the ones you have quoted. Therefore, I have missed nothing, therefore, there must be someting wrong wtih the compiler. 

    PICNIC 

     
    BCCI: therefore, there must be someting wrong wtih the compiler. 

    You are insane. Now on my do no help list. Live in ignorance.

     
    William Roeder:

    You are insane. Now on my do no help list. Live in ignorance.

    *gasps in shock"

    Oh no, I'm not on your "do not help" list?

    How on earth will I sleep at night?

    I'm on someone's do not help list, someone has not helped me in the slightest to begin with? Yes, because that will traumatise me for the next decade, followed by therapy, all because some shcmuck has put me on his little "Do not help" list! Tell me, Bill, that "Do Not Help" list must be growing by the day, mustn't it? 

    "Oh no, some big mean scary man put me on his 'Do No Help' list, Wahhhhhh"

    Wow, and you say I'm insane? Seriously, when you do inevitably burn out in this career, you could work the comedy circuits and then you can tell your audiences about that one time this guy collaborated on the MQL4 forum and you ripped the absolute <Deleted> out of him because you had an ego trip that day and so you called him insane - except the audience won't be laughing at your joke, they'll be laughing at you, except you wont realise this and think you're just hilarious.

    Do us all a favour Bill, delete your account as well, it'll be no great loss to this community here.