MetaTrader 5
TradingView Webhook to MT5: A Setup That Survives a Reboot
Most TradingView-to-MT5 setups work until the VPS restarts. Here's what has to come back on its own afterwards, and how to check it did before your next alert fires.
The setup works on Tuesday. On Wednesday night Windows installs an update and restarts the VPS. On Thursday morning MT5 is still closed, nobody has noticed, and three alerts have fired into a terminal that wasn't there.
Nothing was misconfigured. The setup just had no way of coming back on its own.
A TradingView-to-MT5 setup survives a reboot only if the machine brings itself back without you: Windows signs in automatically, MT5 starts on its own, the chart with the connector reopens, and algorithmic trading is still switched on. Each link is set once. Then you test the whole chain by rebooting on purpose, before an unplanned restart does it for you.
What actually goes down when the VPS restarts?
Execution. Not your alerts.
With Vectorhelm, TradingView sends alerts to our servers, not to your VPS. That address never changes and doesn't go offline when your machine does. What stops during a restart is the last step, the connector in MT5 placing the order at your broker.
That matters for two reasons. Alerts that fire while MT5 is down are discarded rather than saved and fired later, because a queued entry placed several minutes late is a trade at a price your strategy never saw. And your open positions keep their protection, because a stop loss and take profit placed with a trade are real orders sitting at your broker, which executes them whether your VPS is up or not.
Compare that with setups where the alert receiver runs on the VPS itself, usually a local app behind a tunnel. Those lose both halves. The alert arrives at nothing, and when the tunnel restarts it can come back at a different address, so every alert in TradingView is pointing at the old one until you notice.
The full path an alert travels has more places to break than this. The reboot is just the most common one.
The one-time setup inside MT5
Two permissions, a chart, and a code.
Allow algorithmic trading. The AutoTrading button on the toolbar, or Tools → Options → Expert Advisors.
Allow DLL imports for the connector. You can tick it in the connector's own settings when you attach it to a chart, or for the whole terminal in the same Expert Advisors tab.
Then attach the connector to any chart (the symbol doesn't matter) and enter the pairing code from your account. That's done once. The connector reconnects on its own after every MT5 restart, VPS reboot or chart reload, and a new code is only needed if you disconnect the account on purpose, revoke the device, or move to a different terminal.
The account itself needs to be a hedging account. The connector never changes your terminal's settings, and nothing else under Tools → Options needs touching.
What gets installed and why covers the connector in more detail.
Making the VPS bring itself back
Four links, and a reboot breaks the chain at whichever one you skipped.
1. Windows has to sign in by itself. Programs in the Startup folder only start when someone signs in. After an unattended reboot nobody does, so nothing starts, and the VPS sits at the sign-in screen until you connect to it. Turn on automatic sign-in. Use Microsoft's own Autologon tool rather than the registry method in many VPS guides, which leaves your Windows password sitting in plain text.
2. MT5 has to start by itself. Put a shortcut to MT5 in the Startup folder. Type shell:startup into the Run box (Windows key + R) to open it. If you run several terminals, each one needs its own shortcut.
3. MT5 has to log in and reopen the chart. Tick "Save password" when you log into your trading account, so the terminal reconnects without asking. MT5 reopens the charts it had the last time it was closed properly. That last word matters: a forced reboot kills MT5 rather than closing it, and anything you changed since the last clean close can be gone. So after you attach the connector, close MT5 normally once and reopen it. If the chart comes back with the connector on it, the setup is saved.
4. Algorithmic trading has to still be on. MT5 remembers the AutoTrading button, but it has settings that switch it off by themselves. The usual one is "Disable algorithmic trading when the account has been changed," under Tools → Options → Expert Advisors. Log into a second account on that terminal, even briefly, and algorithmic trading quietly turns off for both.
The mistake that looks like a crash
Signing out of the VPS.
When you're done on the remote desktop, close the window. Don't choose Sign out. Closing the window leaves your Windows session running, with MT5 inside it. Signing out ends the session and closes every program in it, MT5 included.
A good share of "my EA stopped overnight" stories are this, and nothing in any log says so. The terminal didn't crash. You closed it.
Restarts you don't choose
Three kinds, and you can only schedule one of them.
Windows updates. Set update restarts to happen outside your trading hours, ideally at the weekend when forex is closed. Many VPS providers manage updates for you, so ask yours who controls the schedule before you assume you do.
MT5 updates itself. When a new build arrives, the terminal downloads it, closes and reopens. The connection drops for a moment and comes back on its own, which is exactly the case auto-start can't help with and pairing persistence covers.
Provider maintenance. Hardware moves and host reboots happen on the provider's schedule. Most announce them. Read the emails.
How do you know it came back?
The connector reports three things separately, because each one fails for a different reason and has a different fix.
What's reported | If it's off | Fix |
|---|---|---|
Connected to Vectorhelm | MT5 isn't running, the chart is closed, or the VPS has no internet | Start MT5, check the chart, check the VPS |
Terminal connected to the broker | MT5 is open but not logged in, or the broker's server is down | Log in, check the account and server |
Algorithmic trading allowed | MT5 is connected but AutoTrading is off | Switch AutoTrading back on |
The third one is the one people miss. A terminal that's connected and logged in, with algorithmic trading switched off, looks perfectly healthy until you notice nothing is trading. It shows up as its own state, connected but trading disabled in MT5, rather than letting it pass for a dropped connection or for a quiet market.
Both directions are recorded. The activity log notes when the connection dropped and why, and when it returned. On reconnect, any trades your broker executed while the terminal was offline, such as a stop or target being hit, are recovered, and the reconnection entry says how many. You get the account as it actually is, not as it was before the gap.
Why MetaTrader's built-in VPS won't work for this
Most MT5 guides recommend MetaQuotes' own virtual hosting first, because it's one click from inside the terminal. For this setup it's the one option that can't work.
MetaQuotes' rules for its hosting state that no DLLs are allowed on the virtual terminal, and that a program which tries to call one is stopped immediately. The connector needs DLL imports. So it needs an ordinary Windows VPS from any provider, or your own machine.
Better to know that before paying for a month of hosting.
Test it before it matters
Reboot the VPS on purpose. Pick a weekend, or pause your strategies first.
Then time it. How long until Windows has signed in, MT5 is open and logged in, and all three states are back? Check the activity log shows the drop and the return. If any link didn't come back, you've found it on your schedule rather than the market's.
A setup you've never rebooted is a setup you haven't tested.
The honest limitation
All of this shortens the gap. It doesn't remove it.
Even a perfect setup is a few minutes without execution while Windows restarts, signs in and launches MT5. Alerts in that window are gone. Your stops are safe at the broker, but nothing new opens and no limit that needs the connection can act until it returns.
If your strategy can't afford a few minutes of absence at certain hours, around a session open, say, the answer is scheduling restarts away from them, not a cleverer setup. And the VPS stays a single point of failure however well it's configured. That's a property of MT5, which only connects through a terminal. Crypto exchange accounts connect without anything running on your side and need none of this.
Before you leave it running
Set up automatic sign-in, the Startup shortcut and "Save password" once. Close MT5 normally and reopen it to make sure the chart comes back with the connector. Check the setting that turns off algorithmic trading on account change. Close the remote desktop window instead of signing out.
Then reboot on purpose and watch all three states come back.
Vectorhelm takes TradingView alerts on its own servers and routes them to your MT5 account through the connector, reporting each of the three states separately so a quiet terminal never passes for a quiet market. It isn't open yet. Early access is here if you want it when it is.
Vectorhelm is execution software. It runs the rules you define on accounts you own and control. Nothing here is trading advice, and no automation setup prevents losses.
Opening soon
Automate it, with your limits built in.
Join the waitlist for free early access. Start on a demo account, then go live when you’re ready.
Join the waitlistStay informed
One email a month. Worth opening.
New articles and product news. No spam, unsubscribe any time.
A separate list from the early-access waitlist. How we handle your email.