What Happens When You Manually Close or Edit an EA's Trade?

person
FXVPS
Share
What Happens When You Manually Close or Edit an EA's Trade?

Your EA has a trade open on GBPUSD. News is coming, you are nervous, so you log in to the VPS and close it by hand. Ten minutes later the EA opens the same trade again. Or you drag its stop loss further away, and a few ticks later it snaps back to where it was.

Stepping in on an EA is sometimes the right call. But an EA is a program following its own rules, and a manual change can confuse it. This post explains how EAs keep track of their trades, what typically happens when you interfere, and how to do it without making things worse.

How an EA Knows Which Trades Are Its Own

Most EAs identify their trades by three things:

  • Magic number. A number the EA stamps on every order it opens. Trades you open by hand have a magic number of 0. See magic numbers: running several EAs on one account.
  • Symbol. An EA on a EURUSD chart usually only looks at EURUSD trades.
  • Ticket number. Some EAs remember the exact ticket of each trade they opened.

Each time it runs, the EA scans the account’s open positions, picks out the ones that match, and manages them. When something you did changes what it finds, it reacts according to its code. Two EAs can react completely differently to the same manual action.

📊 Key Stat: Open trades live on the broker’s server. The EA only sees what is open at the moment it checks. It cannot tell whether a trade closed because of its stop loss, your click, or a stop out.

Closing an EA’s Trade by Hand

What happens next depends on the type of EA:

  • Single-trade EAs usually just notice the trade is gone and wait for the next signal. Fine, unless the entry signal is still true.
  • Signal still true. If the EA’s entry condition is still met, it may simply open the trade again on the next tick or the next bar. That is the “it reopened straight away” case.
  • Grid and martingale EAs track a whole basket. Closing one trade in the middle can make the EA think the basket is smaller than it is, recalculate its next lot size, or close the rest at the wrong level. See grid and martingale EA VPS requirements.
  • EAs with a daily trade limit or loss counter may count your manual close as a loss, a win, or not at all, which changes what they do for the rest of the day.

What can happen after you manually close or edit an EA trade

Moving the Stop Loss or Take Profit

Many EAs manage stops actively: trailing stops, break even moves, or re-setting a fixed stop on every tick.

  • If the EA re-applies its stop on each check, your change is overwritten almost at once.
  • If it trails, it may accept your new stop and trail from there, or put its own back on the next move.
  • If the EA uses a virtual (hidden) stop loss, the broker sees no stop at all. Adding a stop by hand does not change the EA’s own exit, so it may close the trade at its hidden level anyway. See virtual stop loss: hidden SL and TP in EAs.

⚠️ Warning: Removing a stop loss by hand while the EA is off leaves the trade with no protection at all. If you edit stops, make sure every trade still has an exit, either on the broker’s server or in a running EA.

Partial Closes

Closing part of a trade is where ticket based EAs get lost.

  • MT4: a partial close closes the original ticket and opens a new one for the remaining volume, with a comment such as “from #12345”. An EA that remembers the old ticket may stop managing the remainder.
  • MT5 (hedging accounts): a partial close reduces the volume of the same position, which keeps its position ticket. EAs tend to cope better, but lot based logic may still be thrown off.

If you plan to take partial profits, check the EA’s manual first. Many EAs have their own partial close setting that does this in a way they understand.

Opening Trades by Hand on the Same Account

Trades you open manually have magic number 0, so a well written EA ignores them. A poorly written one, or an EA set to manage “all trades” (some trade managers and basket closers do this on purpose), may start trailing or closing your manual trades too. Check the EA’s settings for an option such as “manage manual trades” or “magic number filter”.

Also watch the margin: your manual trades use the same free margin as the EA’s. An EA that sizes by free margin will open smaller trades, and a busy account can reach a margin call sooner. See margin level, margin call and stop out for EA traders.

How to Step In Safely

  1. Pause the EA first. Switch off Algo Trading (MT5) or AutoTrading (MT4), or use the EA’s own pause button or input if it has one. That stops it reopening or overriding while you work.
  2. Make your change. Close, partially close, or adjust the stops.
  3. Decide what the EA should do next. If you want it to carry on, check its manual for how it handles a basket or trade that has changed. Some need a restart, some need you to close everything it opened.
  4. Turn the EA back on and watch the Experts tab for a few minutes.
  5. Write down what you did, with times, in case its results look strange later.

Steps to step in on an EA trade safely

💡 Tip: If you often feel the need to step in before news, look for a news filter in your EA’s settings, or pause it on a schedule. See news trading on a VPS and the news events and strategy filters guide.

Closing From Your Phone

You can close or edit trades from the MT4 or MT5 mobile app while the EA keeps running on the VPS. To the EA, it looks exactly like a manual close in the terminal, with all the same effects described above. The app cannot switch off the EA, so if you need to pause it, log in to the VPS. See using the MT4 or MT5 mobile app with an EA on a VPS.

The Emergency Case

If something has gone badly wrong, for example an EA opening trade after trade, stop the EA first, then deal with the trades. Switch off Algo Trading, remove the EA from the chart, and only then close positions. Closing trades while the EA is still running can make it open new ones as fast as you close them. For a planned safety net, see equity protection and EA kill switches on a VPS.

✅ Best Practice: Read your EA’s manual for a section on manual intervention before you need it. Knowing in advance whether it handles a manual close, partial close or stop change saves you guessing under pressure.

  • Core ($29/mo, 2GB RAM, 1 vCPU): one or two terminals with a few EAs.
  • Pro ($39/mo, 4GB RAM, 2 vCPU): several terminals and EAs.
  • Scaling ($79/mo, 8GB RAM, 4 vCPU): many accounts or CPU heavy EAs.

See the pricing page, or start with the $2.99 7-day trial.

Why FXVPS for EA Traders

  • 24/7 uptime, so your EA manages its trades whether you are watching or not.
  • Log in from anywhere over Remote Desktop to pause an EA or close a trade.
  • Servers near your broker in London, New York, Tokyo, Hong Kong and over 15 locations.

Frequently Asked Questions

Why did my EA reopen the trade I just closed?

Its entry conditions were still met. The EA saw no open trade and opened one, just as it was programmed to. Pause the EA before closing if you do not want it to re-enter.

Why does my stop loss keep moving back?

The EA manages stops itself and re-applies its own level when it checks the trade. Change the EA’s stop loss input instead, or pause it.

Will my EA manage trades I open by hand?

Usually not. Manual trades have magic number 0 and most EAs ignore them. Some trade managers are designed to manage all trades, so check the settings.

Is it safe to partially close an EA’s trade?

It depends on the EA. In MT4 a partial close creates a new ticket, which can make a ticket based EA lose track. Check the manual or use the EA’s own partial close feature.

Can I close an EA’s trades from my phone?

Yes. The EA treats it like any manual close. The app cannot pause the EA, so log in to the VPS if you need to stop it first.