The TradingView webhook URL is how TradingView talks to the outside world — and pairing it with an MT5 Expert Advisor (EA) is what makes fully automated trading possible. This guide covers everything: how webhooks work, what JSON to send, how to configure your EA, and why TradingView Copier Pro is the easiest way to get it all working seamlessly.
📌 Prerequisites: A TradingView paid plan (Essential or above), MetaTrader 5 installed, and TradingView Copier Pro installed on Windows.
How TradingView Webhooks Work
When a TradingView alert condition is met, TradingView can send an HTTP POST request to any URL you specify. This is called a webhook. The POST contains a JSON body — your custom message — which TradingView sends exactly as you write it in the alert message field.
According to TradingView's official webhook documentation, webhooks are available from the Essential plan and above. The URL must be publicly accessible over HTTPS — which is why you need either a VPS or a tunneling tool like the one built into TradingView Copier Pro.
The Webhook URL: How TradingView Copier Pro Provides It
Normally, setting up a public webhook URL requires either:
- A cloud VPS with a static IP address
- Port forwarding on your home router
- A reverse tunneling service (ngrok, Cloudflare Tunnel, etc.)
TradingView Copier Pro handles this automatically. The built-in Cloudflare Tunnel creates a persistent, publicly accessible HTTPS URL from your Windows PC with zero configuration. You just copy the URL displayed in the app and paste it into TradingView.
JSON Message Format Reference
The message you put in TradingView's alert message field becomes the JSON body of the webhook POST. TradingView Copier Pro's EA reads this JSON and executes accordingly.
Basic BUY/SELL Order
{"action":"BUY","symbol":"EURUSD","lot":0.1}Order With SL/TP (in pips)
{"action":"BUY","symbol":"EURUSD","lot":0.1,"sl":50,"tp":100}Risk-Based Lot Sizing
{"action":"SELL","symbol":"XAUUSD","lot":1.0,"lot_type":"percent_balance"}Close All Positions
{"action":"CLOSE","symbol":"EURUSD"}Supported Action Parameters
| Parameter | Values | Description |
|---|---|---|
action | BUY, SELL, CLOSE, CLOSE_BUY, CLOSE_SELL | Trade direction or close command |
symbol | Any MT5 symbol string | The instrument to trade |
lot | Decimal number | Lot size or risk percentage |
lot_type | fixed, percent_balance | How to interpret the lot value |
sl | Integer (pips) | Stop loss in pips from entry |
tp | Integer (pips) | Take profit in pips from entry |
comment | Any string | Trade comment in MT5 |
Setting Up the Expert Advisor in MT5
TradingView Copier Pro auto-installs the TV_Copier Expert Advisor into your MT5 data directory. After installation:
- Open MetaTrader 5
- Press F5 to refresh the Navigator panel
- Find TV_Copier under Expert Advisors
- Drag it onto any chart (it doesn't matter which symbol)
- In the EA settings, ensure Allow Algo Trading is ticked
- Click the AutoTrading button in the MT5 toolbar (it should turn green)
Using Pine Script Variables in Your Webhook
TradingView alerts support dynamic placeholder variables in the message body. These are extremely powerful — you can send the actual price, bar time, or any strategy variable as part of the webhook JSON.
{"action":"BUY","symbol":"{{ticker}}","lot":0.1,"price":{{close}}}The {{ticker}} and {{close}} placeholders are replaced by TradingView with the actual values when the alert fires. This is useful for strategies that calculate lot sizes dynamically in Pine Script.
Connecting Multiple Alerts to One Webhook
You can point unlimited TradingView alerts at the same webhook URL. TradingView Copier Pro processes each one independently, routing BUY commands to BUY trades and CLOSE commands to position closes — all based on the action field in the JSON. This means you can run an entire multi-symbol strategy from a single webhook endpoint.
Get Your TradingView Webhook URL in Minutes
TradingView Copier Pro sets up the whole pipeline for you — webhook URL, EA, Cloudflare tunnel. No coding required.
Get TradingView Copier Pro →Troubleshooting Webhook Issues
- TradingView shows "Webhook error": The URL wasn't reachable — confirm the app is running and the tunnel is active
- EA not responding: Check "Allow Algo Trading" is enabled and the EA is attached to a chart
- Wrong symbol traded: Use symbol remapping in the app settings to map TradingView symbols to your broker's format
- Duplicate trades: Ensure you only have one instance of the EA attached to one chart per account
For more detailed troubleshooting, see our support page or read about why MT5 trades can be slow and how to fix it.