Any questions from a PROFI to a SUPER PROFI - 1. - page 31

 
valenok2003:

dispel any doubts

identical to the following

or is it correct to choose an order first ?

The 2nd option is more correct.
 
Thank you
 
valenok2003:

dispel any doubts
is identical to the following
or is it correct to choose an order first ?

In C/C++ && = short-circuite and.
Which means that if the first condition is not met-
then no operator should run in the second one.

If only Mql had normal wording in the textbook,
instead of this piece of junk https://book.mql4.com/ru/basics/expressions#Log
with a weird wording "True(1) if all values are true",
the specifics would be more expressive.

So... if && works correctly - then both variants are absolutely identical.

 
jartmailru:


So... if && works correctly - then both are exactly the same.


If only, but if only.

In MQL, logical expressions are computed in their entirety, i.e., the so-called "short evaluation" scheme does not apply to them .

 
The 2nd option is not only more correct, it's the only right one:-).
And the documentation is... is a bit strange.
 

In this example, if no order is selected, there is no point in checking the closing time. So the first case will also work correctly. Or is it possible that the order is "not selected" for some other reason than its non-existence?

But what is the order in which the logical expressions are calculated? I.e., if we limit everything to one expression, will we first select the order and then check its close time?

For example, you can write it this way

if(OrderSelect(Ticket, SELECT_BY_TICKET) && OrderCloseTime() > 0){

and not like this

if(OrderCloseTime() > 0 && OrderSelect(Ticket, SELECT_BY_TICKET)){
 

This is not allowed and this is not allowed. In C++ it is UB, here it is highly undesirable according to the principles of normal programming.

If I had doubts before, now I won't use BlueDream 100% for sure. And I don't advise others to do it either.

 
TheXpert:
This is not allowed and this is not allowed. In C++ it is UB, here it is highly undesirable according to the principles of normal programming.

thanks all doubts are resolved
 
TheXpert:

If I had my doubts before, I'm not gonna use BlueDream now 100% for sure. And I wouldn't recommend it to anyone else.

You're jealous of him, aren't you?

Like you don't get wedges?

 

By the way, this is only for MQL4. In MQL5 short evaluation works
Reason: