Hosting and setup

TradingView to MT5: EA Bridge vs Hosted API

Two ways to turn TradingView alerts into MetaTrader 5 trades: an Expert Advisor bridge on a VPS, or a hosted alert URL. Setup, upkeep and failures compared.

The fxapis team3 min read

In short

  • TradingView can send an alert to a URL, but it cannot log in to MetaTrader 5. Something has to receive the alert and place the order.
  • An EA bridge puts an Expert Advisor in a running MT5 terminal — usually on a Windows VPS — that picks the alerts up and trades them.
  • A hosted API gives you an alert URL. TradingView posts to it and the order is placed on your MT5 account, with no EA, VPS or terminal of yours.
  • Either way, check three things: duplicates are traded once, symbols match your broker's names, and you can see why an alert did not trade.
On this page
  1. The problem both solve
  2. Option 1: an Expert Advisor bridge
  3. Option 2: a hosted alert URL
  4. Compared
  5. What to check in any bridge
  6. Next steps

TradingView is where many strategies live; MetaTrader 5 is where many brokers are. Getting an alert from one to an order in the other needs a bridge. An EA bridge runs that bridge inside your own MT5 terminal. A hosted API runs it for you. The trade-off is upkeep against control.

The problem both solve

When an alert fires, TradingView can send an HTTP request to a URL you give it. It cannot add an Authorization header, so it cannot call an ordinary trading API with a key — and it cannot reach into MetaTrader at all. Something has to receive the alert, decide what it means, and place the order.

Option 1: an Expert Advisor bridge

The common setup:

  1. A small service receives TradingView's webhook — yours, or the bridge vendor's.
  2. An Expert Advisor in your MT5 terminal fetches or receives each alert.
  3. The EA places the order from inside the terminal.

Because the EA lives in the terminal, the terminal must be running and logged in whenever an alert can fire. In practice that means a Windows VPS that you keep up: the terminal, the EA and its settings, restarts, and re-logins after the broker drops the connection.

It suits traders who already run an EA, want full control of the logic in MQL5, and are comfortable looking after a server.

Option 2: a hosted alert URL

With fxapis, you create a TradingView hook in the console: choose the MT5 account, a default volume, and how your broker names symbols. You get a secret URL. Paste it into the alert's webhook field, put the order in the message, and the alerts that fire are traded on your account:

Text
TradingView alert fires
  → POST https://api.fxapis.com/hooks/tradingview/<secret>   answered at once
  → the order is placed on your MT5 account
  → the alert and its result appear in the console

The terminal runs in fxapis's cloud. There is no EA, no VPS, and no server of yours.

Compared

AspectEA bridgeHosted alert URL (fxapis)
SetupInstall the terminal and EA, configure the relayCreate a hook, paste its URL into the alert
Must stay runningYour terminal, usually on a VPSNothing of yours
Where the logic livesIn the EA (MQL5)In the alert message
Several accounts per alertOne terminal per accountOne multi-account order, on plans that include it
Updates and re-loginsYoursThe provider's
Typical failure pointsVPS down, terminal logged out, EA stopped, relay unreachableWrong symbol mapping, plan limits, account offline

What to check in any bridge

Duplicates. Alerts can arrive twice. fxapis trades each alert id once — the templates fill it with {{timenow}} — and logs repeats as duplicates. Without an id, the same message twice within 60 seconds counts as one.

Symbols. TradingView's OANDA:XAUUSD may be XAUUSD.a at your broker. A hook can map symbols one by one or add a suffix to all of them.

Speed. TradingView cancels a webhook request that takes longer than three seconds, so the receiver must answer at once and trade afterwards. Keep the account always connected if every second counts; an account that comes online on demand first takes about 10 seconds to connect in our measurements.

Visibility. You will want to know why an alert did not trade. fxapis lists every alert that reaches a hook with what became of it — sent, refused, ignored or duplicate — and the reason in plain words.

Who can send. A hook URL is a credential. By default an fxapis hook accepts requests only from TradingView's published webhook addresses, and you can rotate the URL at any time.

Next steps

FAQ

Questions people also ask

Can TradingView place trades on MT5 directly?

Not on its own. TradingView can send a webhook when an alert fires, but it cannot add an Authorization header or run code in MetaTrader. A bridge — an EA in a terminal, or a hosted service — receives the alert and places the order.

Do I need a VPS to send TradingView alerts to MT5?

Only with an EA bridge, which needs a terminal that is always running. With a hosted alert URL such as fxapis's, the terminal runs in the provider's cloud and nothing of yours has to stay on.

Which TradingView plan supports webhooks?

TradingView lists webhook notifications on its paid plans, not on Basic, and sends webhooks only from accounts with two-factor authentication enabled (TradingView help centre and pricing page, checked 30 September 2026).

What happens if TradingView sends the same alert twice?

With fxapis it is traded once. Put a unique id in the alert message — the templates use {{timenow}} — and a repeat of that id is logged as a duplicate and not sent.

All articles
Hosting and setup

Do You Need a VPS to Automate MetaTrader 5?

Local terminal, rented VPS or hosted API: where MT5 automation actually runs, what each setup asks you to maintain, and when a VPS is the right answer.

3 min read
> Connect. Execute. Scale.

Trade MT5 from your own code.

Connect accounts by login, password and server, and place orders over HTTPS. We run MetaTrader 5; you install nothing.