TradingView Alerts
A TradingView alert is a message. You tell TradingView to send it to TradeHookX, and TradeHookX turns it into a trade on your MetaTrader 5.
In simple words
Your TradingView alert is a letter. The webhook URL is our address. The message inside the letter says what to do ("buy gold, 0.01 lot") and carries your license key, so we know which account it is for.What happens to every alert
TradingView
the alert fires
Webhook
arrives at TradeHookX
Checks
key, plan, safety
Your terminal
the EA places the trade
Signal Log
Executed or Error + reason
Normally the whole trip takes well under a second. Every alert - good or rejected - is listed in the Signal Log.
Before you start
- •A TradingView plan that can send webhooks (Essential or higher). The free Basic plan cannot. TradingView also asks for 2-factor login before webhooks work.
- •A terminal in TradeHookX (cloud or local) - its license key goes into every alert.
- •An alert message from the Alert Builder - recommended, because it is always correct.
Set up an alert in TradingView
Make the message in TradeHookX
Alert Builder → New Alert → choose the terminal and what should happen → Save → Get JSON → copy. See Alert Builder for every field.
Create the alert in TradingView
On your chart click Alert (the clock icon). Choose the condition: your strategy, an indicator, or a price. For strategies, the usual trigger is "Once per bar close".
Paste the webhook URL
Open the Notifications tab, switch on Webhook URL and paste:
https://app.tradehookx.com/webhookPaste the message
In the Message box, delete what is there and paste the JSON you copied. Click Create.
Strategy alerts vs. simple alerts
| Type | When to use | What the message contains |
|---|---|---|
| Strategy (action = According to strategy) | A Pine Script strategy that decides buy / sell / close by itself. | TradingView fills in the direction and size each time: {{strategy.order.action}} and {{strategy.order.contracts}}. One alert handles everything - entries, exits and reversals. |
| Fixed action | A price or indicator alert that should always do the same thing. | A fixed action such as buy, sell, closelong or closeall. Make one alert per action. |
| Symbol | Any | {{ticker}} = the chart's symbol, so the same message works on every chart. Or a fixed symbol like XAUUSD. |
How a strategy alert is executed (close opposite, flip, scale-outs) is explained in Closing Trades.
The checks every alert passes
When an alert is refused, the Signal Log tells you which check failed. The first two checks happen before we know whose alert it is, so those two only show in TradingView's alert log (the webhook answer), not in your Signal Log:
| Check | Refused when... | What you see |
|---|---|---|
| Message format | The text is not valid, the action is unknown or a value is out of range. | TradingView alert log: the reason, e.g. Invalid action "by" |
| License key | The key is wrong, deactivated or the plan expired. | TradingView alert log: "Invalid or expired license key" |
| TradingView username | Binding is on and the message has no or the wrong tv_username. | "Signal rejected: TradingView username mismatch ..." |
| Kill switch | The terminal's kill switch is ON (it blocks entries only - closes still run). | "Kill switch is ON for this terminal - new trades are blocked ..." |
| Close-only | A free trial ended while a copied trade was open: only closes are accepted for 7 days. | Entries refused, closes still work |
| Copy group magic | The terminal leads a copy group and the alert's magic number matches none of its groups (after 24 Oct 2026 12:00 UTC). | "Signal not executed: ..." - see For Leaders |
| Terminal rules | Inside MT5: daily loss hit, max trades, trading hours, pending orders off... | Error with that reason - see Terminal Settings & Risk |
| Too late | The terminal was offline: an entry older than 30 seconds or a close older than 55 seconds is not executed. | "Signal expired" - never a late entry at a bad price |
TradingView username binding
Your license key is like the key to your house. Binding adds a second lock: alerts are only accepted if they also carry YOUR TradingView username. Someone who somehow got your key still cannot trade without it.

Type your TradingView username
Settings → TradingView → type the username exactly as on TradingView → Link. You get a webhook URL and a short verification message.
Send the verification alert
On any TradingView chart create an alert, paste the webhook URL and the verification message (the EURUSD in it is only a placeholder), click Create and let it fire. The code is valid for 10 minutes; Re-send code makes a new one.
Binding active
The page refreshes every 5 seconds and turns green: Binding active. From now on the Alert Builder puts "tv_username" into every message. Make your alert messages again (Get JSON) for alerts created before.
- •A TradingView username belongs to the first TradeHookX account that verifies it.
- •You can switch the binding off and on, or remove it (then alerts are accepted from any TradingView account again).
- •Alerts without the username or with another username are refused and shown in the Signal Log.
Testing safely
The Test button sends a REAL signal
Alert Builder → Test sends your alert through the whole system to your terminal - it really trades. For a strategy alert it sends a buy of 0.01 EURUSD (TradingView's placeholders are filled with buy / EURUSD / 0.01). A test of a close alert really closes trades. Test on a demo terminal, and close the test trade afterwards.- •After a test, open the Signal Log: Executed means the whole path works.
- •In TradingView you can also see the alert log: the webhook answer shows if TradeHookX accepted it.
Good to know
- •One alert = one terminal. To trade the same strategy on two accounts, make two alerts (two messages, two license keys) - or use copy trading.
- •Your license key is secret: never put an alert message in a public script or screenshot.
- •TradingView can send the same alert twice if you created it twice - check your alert list in TradingView when you see doubled trades.