EA Closing Wrong and More
-
Hi
@l-andorrà
@jstapI’ve developed a simple EA that opens a Buy order when specific conditions are met, but I’m encountering a few issues and am unsure of where to start troubleshooting.
-
Backtesting Discrepancies on MT5
In backtesting, MT5 is showing a Buy order (with a small blue arrow) as soon as conditions are met, but since these conditions are based on the closing of the candle, the Buy order should only trigger at the closing ( top ) of the candle, not within the body.
This gives False reading on MT5 Back test. -
Live Testing – Inconsistent Trailing Stop Activation
During live testing, the first trade behaves as expected: it opens at the top of the candle, sets the stop loss, activates the profit trailing when in profit, and closes correctly based on trailing conditions. However, on subsequent trades, even after conditions are met, the profit trailing doesn’t activate as expected, and some trades close much earlier than the trailing stop conditions dictate. -
Unexpected Trade Closures in Live Testing
In another live test, the EA opened a trade correctly, set the stop loss, and worked as expected initially. Partway through, however, the trade closed automatically without reaching the stop loss or profit target. The EA then opened a new trade when conditions were met, but the profit trailing didn’t show.
Could there be something in my setup causing these issues?
As always, your insights or suggestions would be greatly appreciated! -
-
Example Image
