TradingView Webhook Integration
Last updated: July 2026
Turn your TradingView alerts into live orders automatically. When your alert fires, TradingView sends a webhook to etrink, and our EtrinkAgent executes the buy/sell on your MT5 account — 24/7, even while your computer is off.
How it works
TradingView alert → etrink webhook (validates key, symbol & volume limits) → command queue → EtrinkAgent on your MT5 terminal → your broker. Every signal is logged in your panel.
Step-by-step setup
- In your panel open Webhook, pick the account to bind, and click + New key.
- Copy the webhook URL shown once (keep it secret — it can place orders):
https://api.etrink.com/hooks/etrk_xxxxxxxxxxxxxxxx- In TradingView, create an Alert. Enable Webhook URL and paste the URL above.
- Paste the JSON below into the alert Message field:
{
"action": "buy",
"symbol": "EURUSD",
"volume": 0.01,
"sl": 0,
"tp": 0,
"id": "{{time}}"
}- Save. When the alert triggers, the order is executed on your bound account.
Message format
| Field | Required | Description |
|---|---|---|
action | yes | buy · sell · close |
symbol | yes | Broker symbol (e.g. EURUSD, XAUUSD) |
volume | no | Lot size. Subject to your per-account volume limit. |
sl / tp | no | Stop-loss / take-profit price (0 = none) |
id | no | Idempotency key — the same id is never executed twice |
test | no | true = validate only, no real order |
Examples
Sell
{ "action": "sell", "symbol": "XAUUSD", "volume": 0.05 }Close an open position
{ "action": "close", "symbol": "EURUSD" }Dynamic values (TradingView placeholders)
TradingView replaces {{ticker}}, {{strategy.order.action}}, {{close}} and more at send time:
{ "action": "{{strategy.order.action}}", "symbol": "{{ticker}}", "volume": 0.01 }Pine Script example
Use the alert() call so the message (your JSON) is sent to the webhook when conditions are met:
//@version=5
strategy("etrink signal", overlay=true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
if ta.crossover(fast, slow)
strategy.entry("Long", strategy.long)
alert('{"action":"buy","symbol":"EURUSD","volume":0.01}',
alert.freq_once_per_bar_close)
if ta.crossunder(fast, slow)
strategy.close("Long")
alert('{"action":"close","symbol":"EURUSD"}',
alert.freq_once_per_bar_close)Test safely
Add "test": true to any message (or use the Test signal button in the panel). All checks run, the event is logged as test, but no real order is placed.
Troubleshooting
- “symbol not allowed” — the symbol isn't in your allow-list, or the name differs at your broker (e.g.
EURUSD.m). - “no running instance” — the bound account is stopped; it will auto-restart, then resend.
- Volume rejected — above your per-account limit; lower the
volumeor raise the limit. - Every call appears under Webhook → recent events with the raw JSON so you can debug quickly.
Need help? [email protected]