After some extensive testing, it seems there is a bug with how X> and X< behaves related to indicator values... especially when those indicator values are very close together. Based on observation, this appears to be due to rounding. The result is that not all X> and X< events are captured. Let me explain.
I have this condition block, which checks to see if EMA(8) crossed above EMA(13) in the previous candle (Candle ID = 1)...

When I backtest this EA in MT5 I see indicator values that look like this (last four bars)...
Candle ID = 3 (3 candles ago)

Candle ID = 2 (2 candles ago)

Candle ID = 1 (1 candle ago)

Candle ID = 0 (current candle)

Notice how EMA(8) is below EMA(13) for candle 3 and candle 2, but then climbs above it on candle 1 and further above on candle 0. The cross happens on candle 1. That is... it SHOULD happen. But it does not. The condition is never met in the EA. And based on reviewing several such examples, it seems to be related to rounding. It seems that the EA treats EMA(8) and EMA(13) as the same value since they both round to 1.17582, and as a result the "greater than" (>) comparison in the MQL code results in a FALSE value. As such, the cross is never detected.
At least... that's what SEEMS to be going on. Thoughts? How do I make sure ALL of my EMA crosses produce a trigger every time... even when the difference between the EMA values is a fraction of a point? Do I need custom MQL code block and/or some variables to store the EMA values so that this rounding doesn't occur?




