TradingView · MetaTrader 5

TradingView alerts to MT5. No EA, no VPS.

Paste one secret URL into a TradingView alert. When the alert fires, fxapis places the order on your MetaTrader 5 account — there is no Expert Advisor to install, no Windows server to rent, and no terminal to keep running.

  • Indicators and strategies
  • MT5 brokers that allow password sign-in
  • Alerts logged with a reason
TradingView alert
Webhook URL
https://api.fxapis.com/hooks/tradingview/<your secret>

Message
{
  "action": "buy",
  "symbol": "{{ticker}}",
  "id": "{{ticker}}-{{timenow}}"
}
How it works

Three steps, then it runs on its own

  1. 01

    Connect your MT5 account

    Your MT5 login, trading password and the broker's server name. We run the terminal; the password is encrypted on arrival and never shown again.
  2. 02

    Create a TradingView hook

    Choose the account, a default volume and how your broker names symbols. You get a secret URL, shown once.
  3. 03

    Paste it into the alert

    In TradingView's alert, tick Webhook URL, paste the URL, and put one of the messages below in the Message box.
    {"action":"buy","symbol":"{{ticker}}"}
Alert messages

Messages for indicators and strategies

JSON or a line of text — TradingView sends either, and fxapis reads both. Add volume, sl and tp to any of them, or leave them out to use the hook's defaults.

Indicator or drawing: buy
{
  "action": "buy",
  "symbol": "{{ticker}}",
  "id": "{{ticker}}-{{timenow}}"
}
One alert per direction. Uses the hook's default volume.
Indicator or drawing: sell
{
  "action": "sell",
  "symbol": "{{ticker}}",
  "id": "{{ticker}}-{{timenow}}"
}
The same, for the other direction.
Strategy: one alert for every entry, exit and reversal
{
  "action": "{{strategy.order.action}}",
  "symbol": "{{ticker}}",
  "position": "{{strategy.market_position}}",
  "prev_position": "{{strategy.prev_market_position}}",
  "id": "{{strategy.order.id}}-{{timenow}}"
}
On a strategy's alert. The position after each order decides: flat closes the symbol, a flip closes then opens the other side.
Close the symbol
{
  "action": "close",
  "symbol": "{{ticker}}",
  "id": "{{ticker}}-close-{{timenow}}"
}
Closes every open position on the chart's symbol, both directions.
Plain text
buy {{ticker}} 0.10 sl=2300 tp=2400
The shortest form: action, symbol, then optional volume and key=value levels.

Actions: buy and sell open a market position. close (or flat) closes every open position on the symbol; close_long and close_short close one direction; close_all closes everything on the hook's accounts.

Strategies: with position set to {{strategy.market_position}}, a strategy that goes flat closes the symbol and one that flips from long to short closes and then sells. A partial exit — a sell that leaves the strategy still long — is logged and not traded, because there is no single honest way to do it on every kind of MT5 account.

Security

A URL that is a credential, treated like one

A secret URL, shown once

32 random bytes, stored only as a hash. Nobody at fxapis can read it back. Rotate it and the old one stops working at once.

Only from TradingView

On by default: alerts are refused unless they come from TradingView's published webhook addresses (52.89.214.238, 34.212.75.30, 54.218.53.128, 52.32.178.7).

Never traded twice

A unique id in the message makes a resent alert a logged duplicate, never a second order.

Pause without editing TradingView

Pause a hook and its alerts are refused and logged until you resume it. The URL stays the same.

The same checks as every order

Plan limits, account state and the workspace's trading switch apply exactly as they do to an order from the API.

One alert, many accounts

A hook with several accounts sends each alert as one multi-account order, with a result per account.
Plainly

Limits

  • 30 alerts a minute per hook. A strategy that fires faster is in a loop; the rest of that minute's alerts are refused, and one row records it rather than one per alert.
  • Market orders. Alerts open and close at market, with optional stop loss and take profit. Pending orders are placed through the API.
  • 25 hooks per workspace, each with one account or, on plans with multi-account orders, several.
  • Alerts count as orders. They use the plan's monthly orders like any other order.
  • Alert history is kept 30 days. The orders themselves stay in your order history.
  • MetaTrader 5 only. MT4 is not supported.
FAQ

TradingView to MT5, answered

Do I need an Expert Advisor, a VPS or MetaTrader running on my computer?

No. fxapis runs the MetaTrader 5 terminal for your account in our cloud. TradingView sends the alert to your fxapis URL, and we place the order on your MT5 account. Nothing of yours has to stay switched on.

Which TradingView plan do I need?

One that includes webhook alerts — TradingView's pricing page lists webhook notifications on its paid plans, not on Basic — and TradingView requires two-factor authentication on your TradingView account before it will send webhooks (TradingView help centre, About webhooks; both checked 30 September 2026).

Does it work with strategies and with indicators?

Both. An indicator or drawing alert sends a fixed action you choose, such as buy or sell. A strategy alert can send TradingView's strategy placeholders, and fxapis reads the position after each order: going flat closes the symbol, flipping from long to short closes and then opens the other side.

What stops someone else sending orders to my accounts?

The URL contains a secret of 32 random bytes that is shown once and stored only as a hash. By default a hook also refuses any alert that does not come from TradingView's published webhook addresses. You can rotate the URL at any time, which retires the old one immediately.

What happens if TradingView sends the same alert twice?

It is traded once. Put a unique "id" in the message — the templates use {{timenow}} — and a repeat of that id is recorded as a duplicate and not sent. Without an id, the same message twice within a minute is treated as one alert.

How fast is it?

fxapis answers TradingView straight away — TradingView cancels a webhook request that takes longer than three seconds, per its help centre — and sends the order right after. From our servers, an order's round trip to a London broker's trade server measured 96–110 ms. An account set to come online on demand has to connect first, which took about 9.6 seconds in our measurements; keep the account always connected when every second counts.

Which symbol names does it use?

The alert's {{ticker}}, with TradingView's exchange prefix removed (OANDA:XAUUSD becomes XAUUSD). If your broker names symbols differently, add a symbol map (XAUUSD to XAUUSD.a) or a suffix that is added to every symbol.

Can one alert trade several MT5 accounts?

Yes, on plans that include multi-account orders: a hook with several accounts sends each alert as one multi-account order, and each account reports its own result. Starter allows up to 10 accounts in one order, Scale up to 100.

How do I find out why an alert did not trade?

Alerts that reach a hook are listed in the console with what became of each — sent, refused, ignored or duplicate — and the reason in plain words, kept for 30 days. Past 30 alerts a minute, one row records the refusal and the rest of that minute's alerts are not recorded. Each order an alert placed is in your order history like any other.

Does it count towards my plan?

Yes. Orders from alerts are ordinary orders and count towards the plan's monthly orders. On paid plans, orders beyond the allowance are billed per order up to twice the allowance, then new opening orders are refused — and recorded as refused. On Free they are refused at the allowance. Closing is never refused for billing.

Sources for TradingView's rules, checked 30 September 2026: webhook notifications by plan on TradingView's pricing page; the two-factor requirement, the three-second timeout and the webhook addresses in About webhooks.

> Connect. Execute. Scale.

Trade your TradingView alerts on MT5 today

Connect an MT5 account, create a hook, and paste one URL into your alert.