what's wrong? - page 2

 
Ok, I respect your point of view, but I do not agree, simply respect mine.
Without rancor, best regards.
 
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           ))
 
WHRoeder:

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

 
deVries:

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 ) 

 

if ( OrderType() == OP_BUYSTOP || OrderType() == OP_SELLSTOP )

//  is not the same as

if ((OrderType() == ((OP_BUYSTOP) ||(OP_SELLSTOP))))
 
RaptorUK:

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