Every Long, Short and Exit Signal node sends an alert message when it fires, ready for a webhook. TradingView's webhook alerts need a paid TradingView plan.
Entry (Long / Short Signal):
{"side":"buy","ticker":"BTCUSDT","price":67250.5,"qty":0.0148,"amount":995.3,
"leverage":1,"tp":68595.51,"sl":66578,"trail":null,"trail_activation":null}
Exit (Exit Signal):
{"side":"close","ticker":"BTCUSDT","price":68010.2,"qty":0.0148,"leverage":1}
| Field | Meaning |
|---|---|
side | buy, sell or close |
ticker, price | Symbol and the signal bar's close |
qty, amount | Order size in units and its value in the quote currency, from the Order size in the strategy's Properties (change it there, no regenerating). On exits, qty is the position being closed. |
leverage | From Strategy Settings |
tp, sl | Take-profit and stop-loss prices, or null when not used. With trailing on, tp is null. |
trail | Trailing distance in price units, or null |
trail_activation | Price at which the trailing stop should switch on, or null |
Price levels are estimated from the signal bar's close; the real fill happens at the next bar's open, so a bot that places its own orders should treat them as close estimates.
Alerts fire only when the strategy really enters or exits: a repeated signal while a position is already open, or an exit signal while flat, sends nothing.
Take-profit, stop-loss and trailing exits are resting orders inside TradingView's strategy; they don't send an alert of their own when they fill. A bot that trades for real should place or manage those exits from the levels in the entry message.
To match your bot's format, write your own message in a signal node's Alert message field, or once for the whole graph in an Alert Message node. Available tokens:
{{side}}, {{qty}}, {{amount}}, {{tp}}, {{sl}}, {{trail}}, {{trail_activation}}, {{leverage}}{{ticker}}, {{exchange}}, {{close}}, {{open}}, {{high}}, {{low}}, {{volume}}, {{time}}, {{timenow}}, {{interval}}, {{strategy.order.action}}, {{strategy.order.contracts}}, {{strategy.order.price}}Example for a bot that expects its own field names and a secret:
{"action":"{{strategy.order.action}}","symbol":"{{ticker}}","size":{{qty}},
"stop":{{sl}},"take":{{tp}},"secret":"your-bot-secret"}
TradingView itself doesn't fill these placeholders in strategy alert() messages; the editor turns them into the real values when it generates the script, so templates copied from bot guides work as written.
Binance can receive TradingView webhooks directly for USDⓈ-M futures, without a bot of your own. It only opens orders: it does not set take-profit, stop-loss or trailing, change leverage or close positions from a signal — Binance asks you to set those on the position yourself. Its message format needs your personal signal_id and UID:
{"symbol":"{{ticker}}","side":"buy","qty":"{{qty}}","price":"{{close}}",
"trigger_time":"{{timenow}}","signal_id":"your-signal-id","UID":"your-uid"}
For fully automated exits, use your own bot or a bot service that reads take-profit, stop-loss and trailing from the message.
Open webhook.site, copy the unique URL it gives you and use it as the alert's webhook URL. Every alert that fires shows up there with the exact message your bot would get.
More guides: all guides · step-by-step tutorial · what's new