You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
another test if it helps :
See what happens when you remove the "Print("IO1 true");" line
You need to link if statements or have a loop following a non bracketed if , you get one "next line" of code to link what goes in the if block .
So in the example above as is the 1st Print is taking up that line and then what follows belongs to the function scope not the if(IO1)
Similarly , if you remove the 1st print then the if(!IO2) belongs to the if(IO1) but the if(!IO2&&!IO1) belongs to the function scope, unless it was an else if (linking to the previous which was part of the if(IO1) block.
another test if it helps :
See what happens when you remove the "Print("IO1 true");" line
You need to link if statements or have a loop following a non bracketed if , you get one "next line" of code to link what goes in the if block .
So in the example above as is the 1st Print is taking up that line and then what follows belongs to the function scope not the if(IO1)
Similarly , if you remove the 1st print then the if(!IO2) belongs to the if(IO1) but the if(!IO2&&!IO1) belongs to the function scope, unless it was an else if (linking to the previous which was part of the if(IO1) block.
Do not post code that will not even compile. "A - B = false;" is nonsense.
Hi
I recommend using braces - especially with multiple-lined ifs’. I think here the “else” part is not properly read.
For example, here –this second else is connected to “signal type” condition or “indicator X for entry” condition? Add proper braces and it should work then.
Yes you are right … if you remove that line, then second if will be executed only if first if is true … good to know … normally I use brackets as is styling better, but good to know. Thanks
Thanks Fernando, this is actually what i was doing but it was not working....i will check yours and see if all will be good.
Hi
I recommend using braces - especially with multiple-lined ifs’. I think here the “else” part is not properly read.
For example, here –this second else is connected to “signal type” condition or “indicator X for entry” condition? Add proper braces and it should work then.
another test if it helps :
See what happens when you remove the "Print("IO1 true");" line
You need to link if statements or have a loop following a non bracketed if , you get one "next line" of code to link what goes in the if block .
So in the example above as is the 1st Print is taking up that line and then what follows belongs to the function scope not the if(IO1)
Similarly , if you remove the 1st print then the if(!IO2) belongs to the if(IO1) but the if(!IO2&&!IO1) belongs to the function scope, unless it was an else if (linking to the previous which was part of the if(IO1) block.