Back to guides
MT5 EA Disconnected: What Happens to Your TradingView Alerts

MT5 EA Disconnected: What Happens to Your TradingView Alerts

Benjamin F., Co-founder7 min read

When your MT5 EA disconnects, TradingView has no way of knowing and does not wait for it. Alerts run on TradingView's servers, so they keep firing on schedule whether your terminal is closed, your computer is asleep or the connection has dropped. Nothing is held for you in the meantime, so whether any of them still becomes a trade depends entirely on the service receiving them.

This guide covers your open positions and incoming orders during the outage, why replaying missed entries later is usually a mistake, and exactly how PineHook holds your alerts while the EA is offline, so you can set up recovery and have the orders that matter go through once it reconnects.

What keeps working while the MT5 EA is offline#

Your open positions stay open at the broker, and any stop loss or take profit already set on a position is held by the broker's server, so it still triggers while your terminal is off. That is the main reason to give every automated position a stop when it opens, rather than relying on a later alert to close it.

What stops is anything the EA does on its own. Trailing stops, breakeven moves, timed closes and partial-close ladders managed by an EA only act while it is running, and when the terminal goes offline the broker simply keeps the last stop it was given. The PineHook EA saves those settings to disk, so trailing and breakeven pick up again after a restart as long as the position is still open.

cTrader behaves differently

On cTrader, there is no terminal or EA to keep running on your side. PineHook connects to your account in the cloud, so closing your computer does not interrupt anything. A trailing stop without a step uses cTrader's own trailing at the broker and keeps working even if PineHook's connection drops. A trailing stop with trail_step or trail_pct_step, breakeven triggers and ATR-based distances are managed by PineHook instead, so they pause until the connection returns while the broker keeps the last stop. The trailing stop and breakeven docs cover both platforms.

What happens to new TradingView alerts#

TradingView sends each alert once, and its resubmission rules only resend when the receiver answers with a server error, up to three times in quick succession, so an alert that arrives while your terminal is offline is never sent again by TradingView.

That leaves the receiving service with three choices: refuse the alert, hold it and execute it whenever the terminal returns, or hold it and decide case by case. PineHook takes the third approach, keeping the alert in a delivery queue for that license where it appears under Queued Alerts in Signal Logs, and when the EA reconnects, your Missed alert recovery setting decides what runs.

Why replaying missed entries is dangerous#

An entry alert is a decision made at a particular price and time, so executing it ten minutes or two hours later means entering the market at a different price, in conditions that may no longer match the ones the decision was based on. By then, the move the strategy was trying to catch has often already happened, and sometimes the strategy has already sent its exit.

For example, say your terminal goes offline from 13:55 to 15:00, and during that time the strategy sends a buy at 14:00 and a close at 14:30. If both alerts are replayed when the terminal comes back at 15:00, a position opens and immediately closes, which achieves nothing except paying the spread twice. If only the buy is replayed, you end up holding a position that the strategy already exited half an hour earlier. Neither outcome matches what the strategy actually did. Closes and cancels are different. If the strategy wanted out, getting out late is usually better than staying in, and a cancel removes an order nobody wants filled any more.

How PineHook recovers missed alerts safely#

ModeWhat runs after reconnection
Notify OnlyNothing runs automatically, and the missed alerts are listed so you can decide
Closures OnlyEligible closes and cancels run if they are younger than the recovery window you choose, from 5, 15, 30 or 60 minutes

Entries and modifications are never replayed, and on MT5, a compound command such as closelongopenshort replays only its close part, with the Signal Logs row saying so in plain words, so you never have to guess what the recovery did on your behalf. Queue entries that are not recovered expire after 24 hours, and you can clear one by hand at any time, as the missed alert recovery docs explain for both MT5 and cTrader.

A replayed close acts on whatever matches when it runs, so if you also traded by hand while the EA was offline, a broad close can catch that position too. Including a symbol and magic= in close alerts keeps them narrow and predictable.

How to keep the MT5 EA connected#

Most disconnections come from the machine rather than the network, so these checks are worth doing once:

  • Run MT5 on a computer that never sleeps, or on a Windows VPS, which also keeps running through power cuts and home internet outages.
  • Schedule operating system updates outside your trading hours, and make sure MT5 starts again and logs in after a restart.
  • Keep exactly one PineHook chart per license. A second chart using the same license takes over the connection and disconnects the first, which looks like an unstable connection.
  • Set the EA's Connection Profile to match the machine, choosing VPS for an always-on server and LOCAL for a home computer on Wi-Fi.

The Licenses page shows when each MT5 license was last seen, so an EA that has stopped reporting in is visible before an alert fails. If keeping a terminal running is the real problem, a cTrader account avoids it entirely. PineHook connects to cTrader in the cloud with no terminal on your side, and our cTrader vs MT5 comparison explains the trade-off. You can create a PineHook account without payment details and try either platform on a demo account.

What to check after the EA reconnects#

When the EA comes back, compare your open positions with the position the strategy intended, look at the Queued Alerts panel for anything that was not recovered, and read the Signal Logs rows for the alerts that did run. If you changed a position by hand while the EA was offline, MT5 may show a one-time position mismatch notice while PineHook updates its record to match the terminal, and no action is needed unless the notices keep coming.

FAQ#

Will my stop loss still trigger if my computer is off?

Yes, as long as it was set on the position before the terminal went offline. Stops and targets are held by the broker, not by your terminal. Trailing and breakeven moves made by an EA pause until it reconnects.

Can PineHook replay entry alerts after a disconnection?

No. Replaying entries at a later price is exactly the failure this design avoids, and if you want an entry to run at a specific later time, you can schedule it on purpose with delay=.

Does TradingView store alerts while my MT5 EA is offline?

No. TradingView sends the webhook when the alert triggers without knowing whether your terminal is running, so any holding happens at the receiving service.

MetaTrader and TradingView are trademarks of their owners, and PineHook is an independent product that is not affiliated with, endorsed by, or sponsored by MetaQuotes or TradingView. Leveraged trading carries a high risk of loss, so test any automated setup on a demo account before you trade it live.

ShareX

Related posts