EA behaves strangely and opens order in wrong place
-
I made a simple breakout box ea . Unfortunately it sometimes opens order way below or above it is supposed to . I don't think it is anything to do with the spread or slippage ( i could be wrong ). How do i fix this .Not only this one , there was this simple other ea i made which was supposed to open order when the price crossed the sma 10 once each bar . it opened on some bar but it didnot opened in other bars where it was supposed to .
https://fxdreema.com/shared/ehfLo5mC
The main question I guess is why do they behave unpredicatable sometimes ?
opened way below
sell opened way way way below not at the lower edge of box
opened way above
i could give so many examples . -
Your four formula blocks are modified every single tick. This means that all those values are modified every single tick. Maybe you should specify which period of time is to be considered instead of allowing it to happen all the day.
-
@l-andorrà how should i do that ?
-
@reader1 ???
-
@siempre yes ?
-
Try to include a 'Once er bar' block on top of the tree. That way you'll get just one trade per bar (at most) and your 'box' will be updated accordingly.