TradingView webhook to MetaTrader 5, step by step
This guide takes a TradingView alert and turns it into a live MetaTrader 5 trade on your own Windows PC — with a full trace of what happened. About ten minutes if the app is already installed.
What you need first
- Hookmode installed on a Windows PC and paired with your account. The beta is invite-only — join the waitlist if you are not in yet.
- A MetaTrader 5 account added in the app, showing Active.
- A TradingView paid plan (Essential or higher) — the free plan does not send webhooks. Any other system that can POST JSON works too.
1. Create a webhook
In the web app, open Webhooks and create one. Name it after the strategy that will fire it — you will read this name in alerts and traces later.
The new webhook gets an id and a 32-character key; the endpoint URL is the same for every webhook. The key is the only thing that authorizes a call, so treat it like a password. You can rotate it from the webhook page at any time.
2. Link it to your accounts
A portfolio rule links the webhook to an account: which account trades, at what volume factor, with what drawdown budget. Add one rule per account — per challenge, per funded account, per demo.
One signal then fans out to every active rule, and one close signal closes the whole stack.
3. Paste the payload into a TradingView alert
Create an alert in TradingView. In the alert dialog, open the Notifications tab, enable Webhook URL and paste the Hookmode endpoint:
https://api.hookmode.com/api/webhookThen put the payload into the Message field. The webhook page has yours ready to copy — pick the Pine Script format for TradingView. The JSON inside it looks like this:
{ "webhook_id": "…", "signature": "your 32-character key", "side": "buy", "action": "open", "alert_id": "{{timenow}}" }side is buy or sell; action is open or close. {{timenow}} is a TradingView placeholder — it becomes the alert time when the alert fires, and Hookmode uses it to ignore a re-delivery of the same alert for 60 seconds. Optional fields: volume, tpPrice, slPrice — allowed per webhook side, in the side settings.
4. Fire it and read the trace
Trigger the alert — or press the manual trigger button on the webhook page, which runs the same pipeline and is marked “manual” in the trace.
The signal appears on the Signals page within a second or two: received, rules matched, dispatched to your device, opened at the broker with the fill price. If the device is offline, the trade is marked failed with the reason — nothing is queued.
5. Close it
Send the same payload with "action": "close" from a second alert (or the manual close button) — it works when “Allow closing via webhook” is on in the side settings. Hookmode closes the open trades the webhook opened on that side, across every account its rules cover. A stop loss or take profit that closes the trade at the broker first is detected and written back with the real closing price.
Not in the beta yet?
Hookmode is in private beta. Join the waitlist and we write to you when a seat opens.