Getting started

How to send TradingView alerts to MT5 automatically

A step by step setup: connect MetaTrader 5, build the alert message, paste the webhook into TradingView and watch the first trade arrive.

PipRoute team · 2 Dec 2026 · 4 min read

A trading chart on a computer screen in a dark room

Your indicator already tells you when to buy and when to sell. The slow part is you: seeing the alert, opening MetaTrader 5, typing the lot size, setting the stop loss, and doing it again on the next account. This guide connects the two so the alert places the trade by itself.

Here is what happens once it is set up. TradingView fires your alert on its own servers and sends the message to PipRoute. PipRoute checks it, then hands it to MetaTrader 5, which places the trade with your stop loss and take profit. It usually takes about a second, and your dashboard shows every step.

What you need

  • A MetaTrader 5 account at any broker. Start with a demo account while you set things up.
  • A paid TradingView plan. Webhook alerts are not part of the free plan, and TradingView also asks you to turn on two-factor authentication before it lets you use them.
  • A PipRoute login. Your dashboard has everything below: the EA, the Alert builder and your activity log.

Step 1: Connect MT5

Open Connect MT5 in the dashboard. Download your personal EA. It already has your licence and key inside. Put it in MT5's Experts folder, compile it once, allow WebRequest for piproute.com in the Expert Advisors options, attach it to any chart and make sure the Algo Trading button is green.

Step 1 ticks itself green the moment MT5 checks in, and Home shows a heartbeat for the account.

Connect MT5 in PipRoute: three steps that tick themselves
Connect MT5 shows each step turning green as it really happens.

Step 2: Send a test trade

Still on Connect MT5, leave the symbol on EURUSD and the size on 0.01 and press Send test buy. Within a second or two you see the result, and the trade appears in MT5's Trade tab. Press Close it when you are done. If something is wrong, the reason and the fix are shown in plain English, so you are never guessing at a broker error code.

Step 3: Build the alert message

Open the Alert builder. Pick what the alert should do (buy, sell, close, or follow a whole strategy), the lot size or risk, and your stop loss and take profit. The builder writes the message for you. It looks like this:

4F9A2C7B1D0E,buy,{{ticker}},vol_lots=0.10,sl_pips=20,tp_pips=40

{{ticker}} is a TradingView placeholder. TradingView replaces it with the chart's symbol when the alert fires, so one message works on any chart.

The Alert builder writes the message and shows the webhook address
Choose the action and size, then copy the webhook address and the message.

Step 4: Create the alert in TradingView

  1. On your chart, open the alert dialog and choose your indicator and its condition.
  2. Paste the PipRoute message into the alert's Message box.
  3. Under Notifications, tick Webhook URL and paste your account's webhook URL, for example https://piproute.com/hook/AC280BEC72C2. It ends with that account's licence, and you copy it from the dashboard.
  4. Save the alert. For a sell, make a second alert with a sell message.

Your indicator's condition says Any alert() function call? It sends its own buy, sell and close messages. Make one alert, leave the Message box as it is, and paste only the webhook URL.

Using a strategy instead of an indicator? Choose A strategy in the Alert builder. One alert then follows every entry, exit and reversal. See indicator alerts vs strategy alerts.

Step 5: Watch the first real alert

When the alert fires, Home shows the signal travelling to each account and Activity lists the result with the fill price, the ticket number and how long it took. The third step on Connect MT5 ticks green on your first real alert.

Mistakes that catch most people

  • Webhook not ticked. The alert fires in TradingView but nothing reaches PipRoute. Check the Notifications tab.
  • The message pasted in the wrong box. It must go in Message, not in the alert name.
  • A different licence. Each MT5 account has its own licence. Copy the message from the builder with the right account selected.
  • A stop loss that is too tight. Gold and indices need far more pips than EURUSD. The broker refuses stops that are too close to price, and Activity tells you so.
Try it on a demo accountConnect MT5, send a test trade and watch your first alert become a trade.Start free