RaptorUK: IMO a Forum is place where the users can help each other, sometimes that is a simple answer to a question, sometimes it is a more expanded reason for the answer, sometimes it is questions to help the poster to understand.
I agree. Help the poster to learn (even if it's RTFM because he was too lazy,) to see the overlooked mistake (other eyes,) expanded reasons (like 1/2=0,) or complicated non obvious algorithms.
True/False NonZero/0 are interchangeable in mq4.
if ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))
if ((OrderType() == ( 4 || 5 )))
if ((OrderType() == ( true || true )))
if ((OrderType() == true ))
if ((OrderType() == 1 ))
if ((OrderType() == OP_SELL ))
I agree. Help the poster to learn (even if it's RTFM because he was too lazy,) to see the overlooked mistake (other eyes,) expanded reasons (like 1/2=0,) or complicated non obvious algorithms.
True/False NonZero/0 are interchangeable in mq4.
This was something I had to think about William
if ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))
In this case the selected OrderType is never OP_BUYSTOP and OP_SELLSTOP but it can be at most one of them
I think you are overlooking one crucial thing, it is not really relevant what OrderType() is or isn't until ((OP_BUYSTOP) ||(OP_SELLSTOP)) is evaluated and it will always result in true ( 1 ).
From the code given above the test will always be; does OrderType() == true ( 1 )
if ( OrderType() == OP_BUYSTOP || OrderType() == OP_SELLSTOP )
// is not the same asif ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))
I think you are overlooking one crucial thing, it is not really relevant what OrderType() is or isn't until ((OP_BUYSTOP) ||(OP_SELLSTOP)) is evaluated and it will always result in true ( 1 ).
From the code given above the test will always be; does OrderType() == true ( 1 )
Your right with it Simon my mistake have checked it with a test and came to your conclusion.... it is always 1 never 0
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Without rancor, best regards.
I agree. Help the poster to learn (even if it's RTFM because he was too lazy,) to see the overlooked mistake (other eyes,) expanded reasons (like 1/2=0,) or complicated non obvious algorithms.
True/False NonZero/0 are interchangeable in mq4.
I agree. Help the poster to learn (even if it's RTFM because he was too lazy,) to see the overlooked mistake (other eyes,) expanded reasons (like 1/2=0,) or complicated non obvious algorithms.
True/False NonZero/0 are interchangeable in mq4.
This was something I had to think about William
if ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))See now it is always 1
This is something you have to think about William
In this case the selected OrderType is never OP_BUYSTOP and OP_SELLSTOP but it can be at most one of them
I think you are overlooking one crucial thing, it is not really relevant what OrderType() is or isn't until ((OP_BUYSTOP) ||(OP_SELLSTOP)) is evaluated and it will always result in true ( 1 ).
From the code given above the test will always be; does OrderType() == true ( 1 )
I think you are overlooking one crucial thing, it is not really relevant what OrderType() is or isn't until ((OP_BUYSTOP) ||(OP_SELLSTOP)) is evaluated and it will always result in true ( 1 ).
From the code given above the test will always be; does OrderType() == true ( 1 )
Your right with it Simon my mistake have checked it with a test and came to your conclusion.... it is always 1 never 0
Thank you pointing out