How to Connect TradingView to MT4 — Complete 2026 Guide

MetaTrader 4 is still the most widely used platform in retail forex — but TradingView can't place MT4 trades on its own. This guide shows exactly how to bridge the two with Trading Router, so your Pine Script alerts fire real MT4 orders automatically. No coding, setup in under 10 minutes.

Why Still Use MT4 in 2026?

Even with MT5 and newer platforms available, MT4 remains the default for a huge number of brokers and traders. If your broker, your existing EAs, or your custom indicators live in MT4, there's no reason to migrate just to automate from TradingView — Trading Router connects to MT4 exactly the same way it connects to MT5.

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 MT4 terminal within 1 second via the Trading Router Expert Advisor (EA) running on your chart.

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

Step-by-Step Setup

Step 1
Create your Trading Router account and get your tokens

Go to tradingrouter.com/register and sign up. After logging in, open 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 MT4 Expert Advisor

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

Step 3
Install the EA in MetaTrader 4

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

Step 4
Attach the EA to a chart

In the MT4 Navigator panel, find TradingRouterEA under Expert Advisors. Drag it onto any chart (the symbol doesn't matter). On the Common tab make sure Allow live trading is ticked, then in the Inputs tab paste your Client Token. Click OK — you should see a smiley face icon in the top-right of the chart, confirming the EA is running.

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_MASTER_TOKEN, signal=buy, symbol=EURUSD, risk_lots=0.1

To close all open positions on that symbol:

token=YOUR_MASTER_TOKEN, signal=closeall, symbol=EURUSD

The full list of signals and parameters is in the Alert Syntax docs. The message format is identical for MT4 and MT5 — if you already automate one, the other works exactly the same way.

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.

MT4 vs MT5 — Which Should You Connect?

If you haven't committed to a platform yet, here's the short version. The Trading Router setup is the same on both, so pick based on your broker and strategy needs:

 MetaTrader 4MetaTrader 5
Best forForex & CFDsForex, stocks, futures
EA file type.ex4.ex5
Experts folderMQL4/Experts/MQL5/Experts/
HedgingAlways allowedNetting or hedging (broker setting)
Trading Router supportYesYes

Already on MT5? Follow the TradingView to MT5 guide instead — every step below maps directly across.

Common Issues

EA shows a sad face instead of a smiley

A sad face means automated trading is off. Click AutoTrading in the MT4 toolbar so it turns green, and confirm Allow automated trading is enabled under Tools → Options → Expert Advisors.

TradingView alert fires but no trade appears

Open the Experts tab at the bottom of MT4 — 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 MT4 trade?

Start Free 7-Day Trial   Full EA Docs →

Next Steps