Alert Builder

The Alert Builder writes the alert message for you. You choose what should happen with a few clicks, and it gives you the exact text to paste into TradingView - no coding, no typos.

In simple words

It is a form. You fill in "which account, what to do, how big, where to take profit", click Save, and it gives you a ready-made message. You paste that message into your TradingView alert once.
Watch: The Alert Builder1:58 minAll videos
0:00 / 1:58

Make an alert

1

Open Alert Builder → New Alert

Every field has a small ? next to it - click it for an explanation with an example.

The Alert Builder form
The Alert Builder - fill in what you need, leave the rest empty
2

Fill in the fields (all explained below) and click Save

If something looks risky, a "Before you save" window explains it. Go back and fix, or Save anyway.

3

Get JSON → copy into TradingView

Step 1 is the webhook URL, step 2 the message. Paste both into your TradingView alert (see TradingView Alerts).

Get JSON with webhook URL and message
Get JSON - copy the URL and the message

The fields, one by one

FieldWhat it meansExample
TerminalWhich MT5 account this alert trades on. Its license key goes into the message automatically.Exness #61200345 - Cloud
Template name / DescriptionOnly for you, so you can find the alert later.Gold scalper - entries
SymbolWhat to trade. Leave EMPTY to use the chart's symbol ({{ticker}}) - then one message works on every chart. Different name at your broker? Use Symbol Mapping.XAUUSD, EURUSD, US100
ActionWhat should happen - see the list below.According to strategy
CommentA short note stored on the order in MT5. Changes nothing about trading.London breakout

Action - what should happen

ActionWhat the EA does
According to strategy (recommended for Pine strategies)TradingView fills in buy or sell and the size each time the strategy trades. One alert does entries, exits and reversals.
Buy / SellOpens a buy (wins when price goes up) or a sell (wins when price goes down).
Close Buy Positions / Close Sell PositionsCloses your buy (or sell) trades on that symbol - all of them, or only "Lots to close".
Close All PositionsCloses buys AND sells on that symbol. With no symbol in the message it closes them on every symbol.
Buy Limit / Sell LimitA waiting order at a better price: buy when the price FALLS to your level, sell when it RISES to it.
Buy Stop / Sell StopA waiting order for a breakout: buy when the price RISES above your level, sell when it FALLS below it.

Closes only touch trades with the same magic number

A close alert closes the trades whose magic number matches the alert's magic. A close WITHOUT a magic only closes trades that were opened without one (the EA's default number) - not trades of other strategies, and not trades you clicked by hand. More in Closing Trades.

How big - lot size

FieldWhat it meansExample
Lot size (override) - strategy alertsEmpty = the size your Pine strategy sends is used. Type a number to always trade that fixed size instead.empty, or 0.01
Strategy multiplier - strategy alertsPine strategies often send "contracts" (e.g. 100) instead of lots. The EA multiplies: contracts × multiplier = lots.100 × 0.0001 = 0.01 lot
Amount type: Units (lots) - buy/sell alertsA fixed lot size.0.01 = a micro lot
Amount type: Percentage of balanceRisk sizing: the lot is calculated so that if the stop loss is hit you lose this % of your balance. Needs a Stop Loss in pips - without one the EA uses 0.01 lot.1% of $1,000 with a 20-pip SL
Lots to close - close alertsClose only this many lots, taking the OLDEST trades first. Empty = close everything that matches. Less than your broker's minimum closes the whole trade.0.04 of a 0.10 buy

Tip for the multiplier: fire one test trade, look at the lot size in MT5, and adjust until it matches what you want.

Take profit and stop loss

Both are optional, and each can be set three ways:

TypeMeaningExample
Pips from entryA distance from your entry price, in TradeHookX pips.EURUSD 30 = 30 pips
Percentage from entry priceA % of the entry price. Means the same on every symbol - best for gold, crypto and indexes.BTC at 60,000, 1% = 600 away
Fixed priceThe exact price level.1.10500

A pip is not the same size everywhere

TradeHookX counts one pip as 10 of the symbol's smallest price steps. On EURUSD that is 0.0001 (the normal pip). On gold, crypto and indexes it is much smaller than people expect: 100 "pips" on BTCUSD is only about $10. The input box shows a hint for the symbol you typed. When in doubt, use Percentage. A stop that is too close is refused by the broker ("Invalid stops").

Multiple take profits (TP1, TP2, TP3)

Instead of one exit, close the trade in up to 3 steps. For each level type a distance in pips and how many lots to close there.

  • •Example: buy 0.03 lot. TP1 20 pips close 0.01, TP2 40 pips close 0.01, TP3 60 pips close 0.01.
  • •Move SL to entry after TP1 is hit: the rest of the trade can no longer lose.
  • •Move SL to TP1 price after TP2 is hit: the rest of the trade keeps at least the TP1 profit.
  • •The lots do not have to add up. Whatever is left stays open without a take profit.

Breakeven

When the trade is this many pips in profit (Trigger), the EA moves the stop loss to your entry price plus a small Offset, so the trade can no longer turn into a loss.

  • •Example: buy EURUSD at 1.1000, trigger 15, offset 2 → at 1.1015 the stop moves to 1.1002.
  • •Breakeven is always set in pips - the trigger and the offset.
  • •A good start: trigger at about half of your take profit distance.

Trailing stop

FieldWhat it means
Trail distanceHow many pips behind the price the stop loss follows.
StepHow many pips the price must move before the stop is moved again.
Activation (optional)Only start trailing after this many pips of profit.

Set an activation if you also use a stop loss

Without activation the trailing starts at once - a 50-pip stop with a 20-pip trail is immediately tightened to 20 pips. Set the activation to the profit where you want trailing to begin (e.g. your TP1 or breakeven trigger).

Execution mode

ModeIn one sentence
Close Opposite (default for strategies)A signal against your open trade closes that much of it first, and only opens the rest. You never hold a buy and a sell together.
FlipCloses everything on that symbol (both directions) and opens the full size the new way.
MT NativeAlways opens a new trade and never closes anything - for pyramiding or hedging.

Close Opposite and Flip are explained with pictures in Closing Trades. If you choose MT Native for a strategy alert, the builder warns you: every exit of your strategy would open an opposite trade instead of closing.

Magic number

A number stamped on every trade of this alert. Use one number per strategy - the entry alerts AND the close alerts of the same strategy must share it.

  • •Quick picks under the field: reuse a magic your other alerts already use, or take the next free one.
  • •Empty = the EA's default number. Fine if you run only one strategy on the terminal.
  • •Close alert without a magic while other alerts use magics? The builder warns you before saving.

Copy leaders: the group's magic is required

If the terminal leads a copy group, every alert on it - entries AND closes - must carry that group's magic number. The builder shows a "Use 5151 (Gold Liquidity Pro)" button for it. From 24 Oct 2026 12:00 UTC an alert with a different magic is rejected. See For Leaders.

Your saved alerts

The list of saved alert templates
Saved alerts with the Test, Get JSON, Edit, Duplicate and Delete buttons
ButtonWhat it does
CheckRuns every server check for this alert without placing an order (it sends the alert with "test_only": true). The result shows under the template and as a grey Test row in the Signal Log. The checks your EA makes at order time (market open, spread, limits, lot size, margin) are not run.
TestSends the alert for real to your terminal - it REALLY trades (a strategy alert is tested as buy 0.01 EURUSD). Use a demo, and close the test trade afterwards.
Get JSONShows the webhook URL and the message to copy into TradingView.
Edit (pencil)Change the template.
DuplicateMakes a copy - handy for a matching close alert with the same magic.
DeleteRemoves the template (asks first).

Edited a template? Copy the message again

TradingView keeps its own copy of the message you pasted. Changing a template in TradeHookX does NOT change alerts already in TradingView - click Get JSON and paste the new message into the TradingView alert.

One alert to several terminals (alert routes)

An alert route sends ONE TradingView alert to up to 5 of your terminals at the same moment - for example the same gold strategy on your live account and your demo, or on two brokers. Each terminal can trade its own size.

1

Make the route

At the top of the Alert Builder, click New route, give it a name and choose the terminals. For each terminal pick a size rule and save.
2

Use it in a template

In a template, choose the route under Terminal (MT5 Account) - the routes are listed under "Alert route (several terminals)". Get JSON then gives a message with route_key instead of licenseKey.
3

Paste it into TradingView

Paste that message into the alert, as usual. Alerts you already have keep working exactly as before.
Size ruleWhat the terminal trades
Same size as the alertExactly what the alert says.
Multiply the alert sizeEvery lot amount in the alert times your number - entries, partial closes and take-profit lots. 0.5 = half, 2 = double. A result below the broker minimum opens the minimum.
Fixed lotsEvery new trade on this terminal is that many lots, whatever the alert says.
Risk % of balanceEvery new trade risks that % of this account. The alert must have a stop loss, or this terminal refuses the entry.
  • •Each terminal checks its own rules: kill switch, free trial, copy-group magic, symbol map and its EA settings. One terminal refusing never stops the others.
  • •Full closes (close all, close buys, close sells, flip) work the same on every terminal.
  • •With Fixed lots or Risk %, a partial close in lots is sent as the same SHARE of the position when the alert carries the strategy position fields (Alert Builder strategy alerts do). Without them that terminal refuses the partial close and tells you, so you can close it by hand.
  • •The Signal Log shows one row per terminal with a route tag, and you can filter by route. Test on a route template sends a REAL order to every terminal of the route.
  • •Keep the route key private: anyone with it can send alerts to all its terminals. Make a new key (the circular-arrow button) if it was shared - then paste the new message into TradingView.

Copy leaders

A terminal that leads a copy group still needs that group's magic on every alert. Put leader terminals with different magics in different routes.

What the message looks like

You never have to type this, but it helps to recognise it:

a strategy alert
{
  "licenseKey": "TB-XXXXXXXX-XXXXXXXX-XXXXXXXX",
  "symbol": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "size": "{{strategy.order.contracts}}",
  "size_type": "units",
  "lot_multiplier": "0.0001",
  "sl": "1", "sl_type": "percentage_distance",
  "magic": "5151",
  "execution_mode": "close_opposite",
  "tv_username": "yourname",
  "position": "{{strategy.market_position}}",
  "position_size": "{{strategy.market_position_size}}",
  "prev_position": "{{strategy.prev_market_position}}",
  "prev_position_size": "{{strategy.prev_market_position_size}}"
}

The last four lines tell TradeHookX what your strategy held before and after each order, so an exit can never open a trade - see Closing Trades.

Every field is listed in Signal Syntax.