Should an EA reopen a trade you manually closed?

Consider this specific MT5 scenario:

An EA opens a buy position. The user closes it manually, but the entry condition remains true. On the next tick, the EA is allowed to open another position.

Assume there are no other positions or pending orders, and the user has not disabled automated trading.

What should the default behaviour be?

  1. Reopen immediately because the strategy’s entry condition is still valid.

  2. Wait until the condition becomes false and a new signal appears.

  3. Pause new entries until the user explicitly resumes trading.

The design problem is that manually closing a position does not clearly communicate the user’s intention. They may want to exit just that trade, or they may want to stop the strategy from entering again.

One possible approach is to separate “Close position” from “Close and pause new entries” in the EA’s controls. However, a position closed through the terminal would still need a defined handling rule.

For developers: how do you handle this distinction, and should the pause survive a terminal restart?

For users: when you manually close an EA’s position, what do you expect it to do next?

Please focus on the behaviour and implementation rather than specific commercial products. A concrete example or a short explanation of your state-handling logic would be useful.

I treat a manual close as a consumed signal, which is your option 2 in practice. The signal that produced the position is marked as used, keyed by the ticket or the signal bar time, and the EA may enter again only after the condition has gone false and a fresh signal appears. I learned this on my own trade copier. An early version worked from events, and when I closed a copied position by hand while the master still held it, the copier reopened it on the next cycle and kept doing so, a loss loop. Since then every master ticket is copied exactly once and the marker only clears when the master no longer holds the ticket. Option 1 turns a user action into unlimited new risk, so it should never be the default.

The pause has to survive a restart. I keep it in a global variable with the account login in the name, because state that lives only in memory resets on a VPS reboot, usually on the day you need it. Detecting the manual close is simple: in OnTradeTransaction a closing deal on my magic number that I did not send myself is the user, so the EA logs it and stays out until the condition resets.

Andrei Lukoianov:


  1. Wait until the condition becomes false and a new signal appears.


As i user, i would prefer -- at least by default -- to "Wait until the condition becomes false and a new signal appears"...
BUT as a amateur ea coder, i would have an true/false option in ea settings "Allow reopen of trade after manual close when price retraces XXX points from the closing price while same signal remains true." -- with fewer words obviously!