IF - THEN - ELSE logic
-
Hi there.
I want to place in an if block, the following condition with low level code.
if Bid> = X OR Bid <= Y
where X and Y are variables
if this condition is met, go to the next block
can you correct my expression
these are the errors it gives.
Thank you

-
@cesar_defez I am unsure why Or isn't working, but like this should do as you need.

-
@jstap
Hello, you can not place an OR operator, and that it is together in the same box? -
@cesar_defez When I tried to add "OR" in the same box I got the same errors you did.
-
@jstap
Hi, I think I have it fixed.
I have looked around the web and found this.

apparently the operator or, is written "||" (without "").
the expression would be like this:

Bid cannot be used, it gave me an error, so I had to assign the Bid value to a variable (Bid_0).
in this way when compiling it no longer gives me an error.
Thank you @jstap -
@cesar_defez Thank you for this, as usual the fix is quite simple, so OR = ||. I will quite often use a variable to replace functions, might also work different on MT4 compared to MT5.
-
kindly help me with this similar expression in the if condition.
here is the problem to be solved by the expression {a comparative expression}. (MA10 - MA20) > 2(MA 20 - MA50)
The output be true (orange) if logic is correct, else false (yellow)
-
Why can't you use a standard 'condition' block? You can do it there normally. No need to create a new block.