How to Connect TradingView to MT5 (Automated, No Coding)
TradingView can't place trades in MetaTrader 5 on its own. To automate it, a TradingView alert sends a webhook to a bridge service, and an Expert Advisor (EA) running in your MT5 terminal turns that message into an order. With TradingView Link, you create a webhook, install the EA, allow WebRequest, and paste the webhook URL into your alert.
This guide walks through the whole setup: what you need first, the seven setup steps, alert messages you can copy, and what to check when a trade doesn't go through. Test everything on a demo account before you trade real money.
What do you need before you start?
| You need | Why |
|---|---|
| A paid TradingView plan | Webhook notifications are included from the Essential plan up (Essential, Plus, Premium and higher) and aren't available on TradingView's free plan. TradingView pricing |
| 2-factor authentication on TradingView | TradingView only allows webhook alerts when 2-factor authentication is enabled on your account. TradingView help |
| MT5 on a Windows PC or VPS | The EA runs inside your MT5 desktop terminal, so the terminal has to stay open and connected. A VPS keeps it running 24/7. |
| An MT5 broker account | Demo, live or prop-firm. Start with a demo account. For funded accounts, check the prop-firm EA rules first. |
| A TradingView Link account | The free plan (5 alerts a month) is enough to test the setup. |
How does the TradingView to MT5 connection work?
- Your TradingView strategy or indicator triggers an alert.
- TradingView sends the alert message to your TradingView Link webhook URL.
- The TradingView Link EA in your MT5 terminal picks up the instruction and opens, modifies or closes the order with your broker.
How fast that happens depends on your plan: about 20 seconds on Free, about 3 seconds on Basic, about 1 second on Standard and under a second on Pro. One EA attached to a single chart manages every symbol in your Market Watch, so you don't need an EA per symbol.
How do you connect TradingView to MT5, step by step?
Step 1: Create an MT5 webhook in TradingView Link
Sign in to the dashboard, select or create a webhook for your MT5 account, and copy its webhook URL and webhook ID.
Step 2: Download and install the MT5 EA
Download the MT5 EA from the dashboard. In MT5, open File → Open Data Folder,
go to MQL5/Experts, paste the EA file, then refresh the Navigator or restart MT5.
Step 3: Allow algo trading and WebRequest
In Tools → Options → Expert Advisors, enable algorithmic trading and DLL
imports, and add https://tradingviewlink.com to the URLs allowed for WebRequest.
Make sure the Algo Trading button in the toolbar is green.
Step 4: Attach the EA and paste your webhook ID
Drag the EA onto one chart, allow algo trading in its properties, and paste your webhook ID into the inputs. Keep the other settings at their defaults for now.
Step 5: Generate your webhook password
In the dashboard, click Add Secret for this webhook. Every alert message must start with this password on its first line, so keep it safe.
Step 6: Create the TradingView alert
In TradingView, create an alert on your strategy or indicator. In the alert's notifications, turn on Webhook URL and paste your TradingView Link webhook URL. Write the message in the format shown below.
Step 7: Fire a test alert on demo
Trigger the alert and check that the order appears in MT5, in the Trade tab and the Experts log. Then send a close alert to confirm exits work too. If nothing arrives, follow our TradingView to MT5 troubleshooting guide.
What should the alert message say?
Every message starts with your webhook password on the first line. Each line after that is one
instruction: the action, the symbol, the size (q=) and any optional settings.
Buy 0.1 lots of BTCUSD with a stop loss and take profit:
YourWebhookPassword
long BTCUSD q=0.1 sl=1000 tp=300 Let a Pine Script strategy send its own orders. In the strategy, give each entry and exit a
command with alert_message:
strategy.entry("Long", strategy.long, alert_message = "long BTCUSD q=0.06 slp=40000 tp=1000")
strategy.close("Long", alert_message = "flat BTCUSD") Then use this as the alert message:
YourWebhookPassword
{{strategy.order.alert_message}} Orders without an alert_message send an empty line, which places nothing. Don't use
{{strategy.order.action}} here: it sends "buy" or "sell", and the EA expects
long, short or flat. The full walkthrough is in
how to automate a TradingView strategy.
Close every open US500 position:
YourWebhookPassword
flat US500 Tag a strategy with a magic number so several strategies can trade the same symbol:
YourWebhookPassword
long BTCUSD q=0.1 sl=300 tp=600 m=1001 Use the same number on that strategy's flat lines, because a flat only closes
trades with its own number.
How to run multiple strategies on one account explains
the rest.
slandtpare distances in points, sosl=300is 30 pips on EURUSD; useslpandtppfor exact prices, or add%for a percentage, such astp=3%.- The symbol must match your broker's name exactly, including any suffix your broker adds. On
Exness, for example, gold is
XAUUSDmon a Standard account, Pepperstone's retail accounts add.aor.r, and IC Markets calls the Nasdaq 100USTEC: see how to connect TradingView to Exness, Pepperstone or IC Markets. - Limit orders, trailing stops, trading sessions and partial closes are covered in the full documentation.
For every option with copy-paste examples, see TradingView webhook to MT5 and MT4: URL, message format and examples.
What should you check before going live?
- Run every alert on a demo account first and compare the fills with what you expected.
- Check the symbol name, lot size and stop distances for each instrument you trade.
- Keep MT5 running on your PC or a VPS, with the Algo Trading button green.
- Use magic numbers (
m=) when several strategies trade the same symbol. - On a prop-firm account, read the firm's rules on Expert Advisors before you start. Here's how that works on FTMO.
TradingView to MT5 not working? Quick fixes
| Problem | What to check |
|---|---|
| No trades at all | The Algo Trading button is green, https://tradingviewlink.com is in the
WebRequest list, and the webhook ID in the EA matches the webhook URL in your alert. |
| The alert fires but nothing happens | The password is on the first line, the symbol matches your broker's name exactly, and
the action and q= follow the syntax above. |
| WebRequest or connection errors | WebRequest and DLL imports are allowed, and no firewall or VPS rule blocks outbound connections from MT5. |
| TradingView won't save the webhook | Turn on 2-factor authentication, and check that your plan includes webhooks. |
Every EA message and MT5 return code, with its fix, is in TradingView to MT5 not working? How to fix it.
How much does it cost?
| Plan | Price | Alerts | Typical latency | Also includes |
|---|---|---|---|---|
| Free | $0 | 5 alerts per month | ~20 seconds | Enough to test your setup |
| Basic | $4.99/month | 500 alerts per day | ~3 seconds | Telegram trading & alerts, webhook dashboard |
| Standard | $9.99/month | 3,000 alerts per day | ~1 second | Telegram, webhook dashboard, alert logs |
| Pro | $19.99/month | 7,000 alerts per day | Sub-second | Alert sharing, Telegram, webhook dashboard, alert logs |
Every plan works with both MT4 and MT5. Paid plans start with a 7-day free trial; if you don't subscribe when it ends, your account moves to the free plan. You can cancel at any time, and prepaid fees are non-refundable.
Frequently asked questions
Can TradingView connect to MT5 directly?
No. TradingView has no built-in link to MetaTrader 5. To trade automatically you need a webhook bridge plus an Expert Advisor (EA) running in your MT5 terminal, which is what TradingView Link provides.
Do I need a paid TradingView plan?
Yes. Webhook notifications are included from TradingView's Essential plan up and aren't available on the free plan. TradingView also requires 2-factor authentication on your account before it sends webhook alerts.
Does my computer have to stay on?
Yes. The EA runs inside your MT5 terminal, so MT5 has to be open and connected for trades to be placed. Many traders run MT5 on a Windows VPS so it stays online 24/7.
Can I automate a Pine Script strategy?
Yes. Give each entry and exit in your strategy a TradingView Link command with Pine's alert_message parameter, such as alert_message = "long BTCUSD q=0.1", and put {{strategy.order.alert_message}} in the alert message. Don't use {{strategy.order.action}}: it sends "buy" or "sell", and the EA expects long, short or flat.
How fast are trades placed?
It depends on your plan: about 20 seconds on Free, about 3 seconds on Basic, about 1 second on Standard and under a second on Pro. Your broker's own execution time comes on top.
Does it work with prop-firm accounts?
TradingView Link works with demo, live and prop-firm MT5 accounts. Every firm has its own rules on Expert Advisors, so check them before you connect a funded account.
Is there a free plan?
Yes. The free plan includes 5 alerts a month, which is enough to test your setup. Paid plans start at $4.99 a month and begin with a 7-day free trial. No credit card is required.
Related guides
- How to connect TradingView to MT4
- PineConnector alternative with MT4 support
- Best TradingView to MT5 bridges, compared
- Free TradingView to MT5 bridge: what you get for $0
- Free and cheapest TradingView to MT4 bridges
- How to automate a TradingView strategy on MT4 and MT5
- TradingView to MT5 not working? How to fix it
- Prop-firm EA rules: FTMO, FundedNext and The5ers
- TradingView webhook to MT5 and MT4: URL, message format and examples
- TradingConnector alternative for MT4 and MT5
- WebhookTrade alternative for MT4 and MT5
- How to convert Pine Script to MQL5, and when not to
- Does TradingView's free plan have webhooks? Plans compared
- Do you need a VPS for TradingView to MT5?
- How to automate a TradingView strategy on FTMO
- FundedNext TradingView automation: EA rules and setup
- How to run multiple strategies on one MT5 account with magic numbers
- TradeSgnl alternative: pricing, MT4 support and TradeSgnl vs PineConnector
- How to send TradingView alerts to Telegram and MT5
- MetaConnector alternative: pricing, MT4 support and MetaConnector vs PineConnector
- SignalForge alternative: pricing, hosting and SignalForge vs PineConnector
- TradingView.to alternative: TradingView To Anywhere vs TradingView Link
- How to connect TradingView to Exness (MT4 and MT5)
- How to automate TradingView alerts on Pepperstone (MT4 and MT5)
- How to automate TradingView alerts on IC Markets (MT4 and MT5)
- How to automate TradingView alerts on XM (MT4 and MT5)
- How to automate TradingView alerts on Vantage (MT4 and MT5)
- How to automate TradingView alerts on Fusion Markets (MT4 and MT5)
- How to automate TradingView alerts on RoboForex (MT4 and MT5)
- How to automate TradingView alerts on JustMarkets (MT4 and MT5)
- Pricing: plans, limits and what else you pay for
- Full documentation: alert syntax, EA settings and troubleshooting
- FAQ: trials, billing and signal limits