How to Connect TradingView to MT5 — Complete 2026 Guide

TradingView lets you build powerful strategies in Pine Script, but it can't place trades in MetaTrader 5 on its own. This guide shows exactly how to bridge that gap using Trading Router — no coding required, setup in under 10 minutes.

What You Need Before You Start

How the Connection Works

TradingView supports "webhook alerts" — when your indicator or strategy triggers, TradingView sends a message to a URL you specify. Trading Router provides that URL. Our server receives the message and forwards the trade instruction to your MT5 terminal within 1 second via the Trading Router Expert Advisor (EA) running on your chart.

The flow is: TradingView alert → Trading Router server → MT5 EA → trade executed.

Step-by-Step Setup

Step 1
Create your Trading Router account and get your token

Go to tradingrouter.com/register and sign up. After logging in, go to your Dashboard and copy your Master Token and Client Token — you'll need them for the TradingView alert message and the EA

Step 2
Download the MT5 Expert Advisor

Go to Downloads and download the Trading Router MT5 EA (.ex5 file). This is the piece of software that lives inside MT5 and listens for instructions from Trading Router's server.

Step 3
Install the EA in MetaTrader 5

In MT5, open the data folder: File → Open Data Folder. Navigate to MQL5/Experts/ and copy the .ex5 file there. Restart MT5, then go to Tools → Options → Expert Advisors and enable Allow algorithmic trading and Allow DLL imports.

Step 4
Attach the EA to a chart

In the MT5 Navigator panel, find TradingRouterEA under Expert Advisors. Drag it onto any chart (the symbol doesn't matter). In the Inputs tab, paste your Client Token. Click OK. You should see a green "EA running" icon in the top-right of the chart.

Step 5
Create a TradingView alert with the webhook

In TradingView, right-click on your chart or strategy and choose Add Alert. Set the condition to your indicator/strategy. In the Notifications tab, check Webhook URL and paste your Trading Router webhook URL (https://webhook.tradingrouter.com). In the Message field, paste the signal body.

The Alert Message

A simple buy order looks like this:

token=YOUR_CLIENT_TOKEN, signal=buy, symbol=EURUSD, risk_lots=0.1

To close all open positions on that symbol:

token=YOUR_CLIENT_TOKEN, signal=closeall, symbol=EURUSD

The full list of signals and parameters is in the Alert Syntax docs.

Test Your Setup

Before going live, use the Test Alert tool in your Trading Router dashboard. It sends a simulated signal to your EA so you can confirm the connection is working without placing a real trade.

Common Issues

EA shows "no connection" icon

Check that Allow DLL imports is enabled in MT5 Options. If you use VPS, also make sure your VPS's firewall isn't blocking outbound connections from MT5.

TradingView alert fires but no trade appears

Check the MT5 Journal tab — Trading Router EA logs every received signal there. Confirm the token in the alert message matches your dashboard token exactly (case-sensitive).

Wrong symbol name

Some brokers add suffixes to symbol names (e.g., EURUSDm instead of EURUSD). Use the Symbol Map feature in the EA settings to translate between TradingView and broker symbols automatically.

Ready to fire your first automated trade?

Start Free 7-Day Trial   Full MT5 Setup Docs →

Next Steps