How to Connect TradingView to MT5 with Webhooks (2026 Guide)
Step-by-step guide to connecting TradingView alerts to MetaTrader 5: webhook setup, alert JSON, EA installation, and firing your first automated trade in under 10 minutes.
July 15, 2026 · 9 min read · TradeHookX Team
Why connect TradingView to MT5?
TradingView has the best charting and strategy tools in retail trading, but it cannot place trades on a MetaTrader account. MT5 executes trades, but its built-in strategy tools are a fraction of what Pine Script offers. Connecting the two gives you the best of both: strategies built and backtested on TradingView, executed automatically on any MT5 broker account.
The connection mechanism is a webhook. When your TradingView alert fires, TradingView sends an HTTP POST message to a URL you specify. A bridge service receives that message, translates it into a trade instruction, and your MT5 terminal executes it - typically in milliseconds. No code, no manual clicking, no missed entries at 3am.
What you need before starting
- •A TradingView plan that supports webhook alerts (Essential or higher - the free Basic plan does not include webhooks, and TradingView requires 2FA for webhook alerts)
- •An MT5 account with any broker - demo is perfect for your first setup
- •A bridge account: TradeHookX includes a 7-day free trial on every plan, no card required
- •About 10 minutes
Step 1: Get your webhook URL and license key
After registering, your dashboard shows two things you will use everywhere: a webhook URL (where TradingView sends alerts) and a license key (which ties signals to your account). Both are ready the moment you sign up.
Step 2: Connect your MT5 terminal
You have two options. Self-hosted: download the Expert Advisor from the Terminals page, drop it into your MT5 Experts folder, enable algorithmic trading and DLL imports in the terminal options, attach it to any chart, and enter your license key. Cloud: on Advanced and Professional plans, skip the installation entirely - pick your broker from a 25+ broker library, enter your account credentials, and a hosted terminal deploys with the EA pre-installed, running 24/7 without your PC.
Either way, your terminal shows Online on the dashboard within seconds of connecting.
Step 3: Create the TradingView alert
In TradingView, create an alert on your indicator, strategy, or price level. In the alert dialog, open the Notifications tab and paste your webhook URL. The Message field carries the trade instruction as JSON. The easiest path is the Alert Builder on your dashboard - it generates the exact JSON, including your license key and TradingView username binding. A minimal example:
{ "licenseKey": "TB-XXXX-XXXX-XXXX", "action": "buy", "symbol": "EURUSD", "size": 0.01, "sl": 20, "tp": 40 }Step 4: Fire a test
Trigger the alert manually or use the Webhook Tester on your dashboard. Within milliseconds the signal appears in your live feed and the position opens on your MT5 terminal. If the trade does not appear, the feed shows exactly why - a risk guard, a symbol mismatch, or a terminal issue - so you never debug blind.
Going beyond a basic buy
Once the pipeline works, the same alert message supports far more than entries: pending orders (buy limit, sell stop), multiple take-profit levels with partial closes, automatic breakeven, trailing stops, risk-based position sizing, and strategy tags for running several systems on one account. For fully dynamic strategies, TradingView placeholders let one alert handle both directions - the action field becomes the strategy signal itself.
Common mistakes to avoid: using the TradingView free plan (no webhooks), forgetting to enable DLL imports in MT5, setting take profit closer than your broker minimum stop level, and running untested strategies live - always start on demo.
Keep reading
Ready to automate your strategy?
7-day free trial on every plan. No credit card required.
Start free trial