[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 309

 
I have it written like this:

if this and that, then it's "equal to".

If it is equal to "True" then the order opens.



If I write if this and that, the order opens. will this solve the problem?

 
AndEv:
Actually the expression looks like this: if(a>b || (a<=b && c>d)). If the truth check is performed from left to right, the expression a<=b will be superfluous from the viewpoint of speeding up the program. The question was exactly whether it is from left to right or vice versa, or differently in different cases.
In that case, you have to create nested ifs. In MQL4, the order is unclear. In MQL5, it is from left to right as it should be.
 
artmedia70:

Special arrow codes that accurately indicate the price and time. Can be the following values:

Constant Value Description
1 Upward pointing arrow with a prompt to the right(↱)
2 Down arrow with guide to the right(↳)
3 Left pointing triangle(◄)
4 Symbol Dash (-)
SYMBOL_LEFTPRICE 5 Left price marker
SYMBOL_RIGHTPRICE 6 Right price marker

Special arrow codes cannot be used in custom indicators when setting the arrow value for lines with DRAW_ARROW style.


Thank you for your help
 
sammi61:

Please advise what is the reason, EA does not open orders, writes error 133
https://docs.mql4.com/ru/constants/errors - no trading allowed
 
AndEv:

Actually the expression looks like this: if(a>b || (a<=b && c>d)). If the truth check is performed from left to right, the expression a<=b will be superfluous from the viewpoint of speeding up the program. The question was whether it is from left to right or vice versa, or differently in different cases.

The expression a<=b cannot become superfluous because it is an element of conjunction. A conjunction is true only in one case, when all its conjuncts are true. If at least 1 of them is false, the whole conjunction is false. In your case, if atom a>b is false, the if() condition will hold when the expression ( a<=b && c>d) is true (the conjunction). And it will be true only if a<=b is true andc>d is true.
 
drknn:
The expression a<=b cannot become superfluous
It is redundant. Draw a truth table.
 
TheXpert:
It is unnecessary. Draw a truth table.


Yeah, right, I missed it. You don't need the truth table here either. If expression a>b is false, then expression a<=b will always be true. So the formula a>b || (a<=b && c>d) will take a form: a>b || (1 && c>d). Applying the rule of exclusion of truth from conjunction we arrive at the final form: a>b || c>d.

But I won't remove my previous explanations - let a person understand it - it will come in handy more than once.

 
drknn:


Yeah, that's right, I missed it. You don't need the truth table here either. If expression a>b is false, expression a<=b will always be true. So the formula a>b || (a<=b && c>d) will look like this: a>b || (1 && c>d). Applying the rule of exclusion of truth from conjunction we arrive at the final form: a>b || c>d.

But I won't remove my previous explanations, though - let the man understand it - it will come in handy more than once.

Isn't it easier then to write that the truth is always except a<=b && c<=d ?
 
GarKain:
is it not easier to write that the truth is always true except a<=b && c<d ?

I don't understand the question. Write the full formula.
 

Afternoon. My advisor, gives 20-40% a year of the deposit is normal or a waste of time.

Reason: