No! It means this:
if( BarTime != Time[0] ) { if( (boolean expression A) && () && () && () ) { if( (boolean expression B) && () && () && () ) { OrderSend(); // Will only execute if all of the above are true! } } } OrderSend(...); // Will always execute irrespective of the above
It also means this:
if( ( BarTime != Time[0] ) && (boolean expression A) && () && () && () && (boolean expression B) && () && () && () ) { OrderSend(); // Will only execute if all of the above are true! } OrderSend(...); // Will always execute irrespective of the above
Suggestion: Always use braces for your "if" code blocks, irrespective of it being nested or not, irrespective of it only having one instruction or not, and always "style" or properly format and indent your code levels, and you will always be able to see the logic of the code more clearly.
if( boolean expression ) { // Execute if true } else { // Execute if false };
NB! By the way, your example code has two extra closing braces at the end which would cause a compile error!
Thanks Fernando, much appreciated.
<Deleted>
<Deleted>
<Deleted>
Take this as your last warning.
Your attitude will not be tolerated in this forum.
Take this as your last warning.
Your attitude will not be tolerated in this forum.
Sorry Keith, you're right.
.
In addition to this, I'm just getting errors that should not exist and that I have clearly addressed:
"'if' - semicolon expected xxx 321 13" - there doesn't need to be a semicolon. I do not want to terminate the EA here.
"'(' - unbalanced left parenthesis xxx 319 12" - there are no unbalanced parenthesis - can see both parenthesis.
"')' - unexpected token xxx 334 92" - why is this token unexpected when the relevant coding is the correct way?
"'&&' - operand expected xxx 327 13" - again, no errors here either.
"'else' - semicolon expected xxx 324 10" - again, no semicolon is required.
I think there is a compiling issue with MetaEditor, I'm going to report a bug with them today because this getting silly now. There is absolutely nothing wrong with my coding. All I can say is thank God I'm not paying for this software because many poor innocent traders will be getting ripped off big style!
Are you sure it is a software bug of such magnitude and nobody except you is having this issue?
Are you confident enough about coding to ask such a rookie question about if-statements and still assume your code is correct?
You already seem to have issues understanding the sense of ";" for a line termination and want to report a bug?
My assumption is, you will soon be reporting the next bug, concerning floating point numbers being buggy.
This said, try to catch some knowledge by reading example code provided with the terminal and in the codebase, or maybe take the time and read the documentation, available online and offline.
Or watch some YouTube videos about coding.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Quick question, does the following code mean "If either A OR B is true, execute position"?
Many thanks