Automate TradingView alerts to MT4
Turn a TradingView alert into a MetaTrader 4 order flow without manual copying. TheConnector receives the webhook, validates the target account and routes the signal to the connected MT4 terminal.
When this workflow fits
Use this route when your strategy logic lives in TradingView but execution still belongs on MetaTrader 4.
- Pine Script alerts routed to MT4
- Routing to one or several allowed accounts
- Daily webhook limits enforced by plan
Technical points to lock
Symbol mapping matters when the broker adds suffixes, prefixes or instrument names that differ from TradingView.
- Map XAUUSD to XAUUSDm or GOLD when required
- Keep the webhook payload stable
- Test every MT4 account before scaling volume
Useful next pages
The MT4 workflow connects pricing, symbol mapping and documentation so setup stays easy to follow.
- Review Free access and future plans
- Understand broker symbol mapping
- Read the setup guides
Webhook payload example
Keep payloads explicit: the account connector can route the alert only when the action, symbol and target platform are clear.
{
"action": "buy",
"symbol": "EURUSD",
"risk": 0.5,
"sl": 15,
"tp": 30,
"source": "TradingView",
"id": "tv-tradingview-to-mt4-test-001",
"account": "DEMO-MT4-001",
"platform": "mt4"
}
Alert pattern to adapt
Use this as a reading pattern, then adjust order size, symbols and account routing before any real use.
//@version=5
indicator("The Connector webhook", overlay=true)
fast = ta.sma(close, 9)
slow = ta.sma(close, 21)
longSignal = ta.crossover(fast, slow)
if longSignal
alert("{\"action\":\"buy\",\"symbol\":\"" + syminfo.ticker + "\",\"risk\":0.5,\"sl\":15,\"tp\":30,\"source\":\"TradingView\",\"id\":\"" + syminfo.ticker + "-" + str.tostring(time) + "\",\"account\":\"DEMO-MT4-001\",\"platform\":\"mt4\"}", alert.freq_once_per_bar_close)
Limits to keep in mind
- Test each alert on a demo account before production.
- Broker, platform and network conditions still matter: validate the route before increasing volume.
- Use symbol mapping to adapt broker-specific names before sending live signals.
- A signal that arrives too late must be treated as expired rather than replayed.
MT4 checklist before any live route
MT4 is widely used, but the terminal must be ready before an alert can become an instruction: AutoTrading, EA permissions, exact broker symbols and lot steps must all be checked in demo first.
- AutoTrading is enabled in MT4 and the EA is attached to the expected chart.
- WebRequest or network permissions required by the EA are allowed.
- Broker suffixes, prefixes, minimum lot and lot step are tested on a demo account.
Demo-first payload for this platform
Use placeholders only. With a per-account webhook URL, account and platform are optional but useful when documenting a shared route.
{
"action": "buy",
"symbol": "EURUSD",
"volume": 0.10,
"sl": 15,
"tp": 30,
"source": "TradingView",
"id": "tv-tradingview-to-mt4-demo-001",
"account": "DEMO-MT4-001",
"platform": "mt4"
}