USING OR AND EFFICIENCY
-
Take a look at this pic. One row has a variation for the same condition and then they are all the same in the next set but the next row has a variation in its conditions.
I believed I used OR correctly but I'm wondering if there was a more efficient way to use it so that I didn't have to copy all the above conditions.
In other words, could I have used the static conditions just once and then used OR to ONLY address the variations?
-
"OR" block is something like Once Per Tick. Each "OR" block can pass 1 time for the current tick. It doesn't care and is not aware of other blocks. So everything above it will run on every tick for sure, even if it's not needed. All those green blocks on top run on every tick, just because they are on top level.
Yes, this is not very optimal way of doing things. This way is better - https://fxdreema.com/demo/mt4-or-logic-1
I don't think you need 6 different "Once per bar" blocks connected like this. How it will work if you use only 1 of them? If the logic is the same, just use one. Also, I don't know what's in "Check trades count" and "CCI < 0", but if all of them are the same too, then what will happen if you use only one group of them, not 6?
-
-
Looking at your example: I thought the Yellow created an "if opposite" then...rather than, just if it's not true. (Because not true doesn't necessarily always mean exact opposite).
-
Also, does OR apply to the blocks below or above it? I was thinking above since the example in the "examples" section explains that only one of each group above the OR would trigger:
https://fxdreema.com/demo/mt4-or-logic-2
Does this produce the same result as the previous pic?
......
USING OR IN GROUPS2.jpg -
-
- In most cases the yellow output in "Condition" means "else". Only when you work with x> or x< the yellow output is the opposite (x< or x>)
- Again, imagine that "OR" block has name "Once per tick". It can pass 1 time for the given tick.
-
That clarifies a lot for me (if you look through my question history, you'll see I had trouble understanding how the yellow works)
So I want to confirm, yellow does mean if the previous condition is false, then...(unless we are talking x< or x>)
Also, does the diagram show the same result that using yellow would have (instead of OR)?
btw, this program is great, if there is any other forum out there that you want me to give a shout out, let me know.
-
Again, "OR" is actually something that can pass 1 time for the current tick. If block 701 reaches block 1229, then 1229 will pass. Then if 1183 passes and reaches 1229, it will not pass again. On the next tick everything starts again.
The yellow output in most block is actual "else" in the code. Not all, but most of them. Each block has some description and I wrote there which output means what
-
Okay, I'm pretty sure you're describing what I wanted.
I only want 1 of those above OR to be executed before continuing for each tick.
Also, those 3 OR conditions are all X> or X< so am I best to use OR rather than yellow line, since the yellow line would interpret it as meaning the opposite of X< or X>?
Otherwise I would much prefer to use the yellow line if it will achieve the same affect rather than this mess I've created.
-
Well, blocks 701, 1183 and 1288 will all run once 9927 passes. That "OR" below cannot stop this. Obviously in this situation the behaviour of the yellow output in case of crossover does not help. But this rule for the yellow output for crossover is as old as fxDreema, this was one of the first features. If I have to decide now, I will probably choose to not do it like this.
Fun fact - in the beginning Condition and Formula blocks were 1 single block

-
But in this case doesn't OR only pass if 1 of the 3 above are true?
-
I told you few times. "OR" is like Once per tick. You can run it 100000 times in that tick and it will pass 1 time. On the next tick - the same happens. "OR" block is not aware of other blocks. "OR" does not care what is above or below it. "OR" does not have control over other blocks.
With "OR"
https://fxdreema.com/shared/bXPswk7xe
http://prntscr.com/aafjcoNo "OR"
https://fxdreema.com/shared/JNLyZbopc
http://prntscr.com/aafjqf