TradingView webhook payload
Exact fields read by WebhookIngress when a TradingView alert reaches TheConnector.
Purpose
This page documents the public WebhookIngress contract for TradingView alerts. It is not the dashboard manual-order payload.
Access path
- In the client workspace:
My accounts> open a trading account > copy the access key. - In TradingView:
Alert>Notifications> pastehttps://webhook.theconnector.fr/YOUR_ACCESS_KEYinWebhook URL. - In TradingView's
Messagefield, paste the message: JSON or one line, as you prefer.
Two formats, same result
WebhookIngress reads two message formats and handles them exactly the same way: a JSON object, or a single line of text. Use the one you prefer. On one line, the action and the symbol come first, then the other fields as name=value, separated by commas.
Minimal JSON
{
"action": "buy",
"symbol": "EURUSD",
"risk": 1,
"sl": 0.2,
"tp": 0.4,
"priceMode": "percent"
}
priceMode gives the unit of sl, tp and price in the alert itself: price, pips or percent. Here the stop is 0.2% from the entry and the target 0.4%, whatever the account's price mode; without priceMode, the account's price mode applies.
Fields read by WebhookIngress
actionis required. Accepted aliases, in JSON as on one line:side,type,command,msgtype.typenames the command, not an order type:buywithtype=limitgives two different commands, and the alert is refused — a pending order has its own command,buylimit,selllimit,buystoporsellstop, with its entry price inprice.symbolis required for trading commands. Accepted aliases:pair,ticker,instrument,market,asset.riskis passed as a numeric risk value. For explicit lot size, usevolume,lot,lots,fixedVolumeorsize.slandtpare the current stop loss / take profit names. Accepted aliases:stoploss,stop_loss,takeprofit,take_profit.priceis used only for pending orders:buystop,buylimit,sellstop,selllimit.expiration(aliasexpiry) gives a pending order a lifetime, in minutes: the broker deletes it if it has not been triggered by then, even with the robot switched off. Example:"expiration": 60. It is ignored on market orders. It needs robot 0.0.30 or later: with an older robot the alert is refused rather than leaving the order pending indefinitely. If the broker does not accept an expiration on that symbol, the order is refused, never placed without it.priceModesets the unit ofsl,tpandpricefor this alert:price,pipsorpercent. Without it, the account price mode applies.ticket,orderId,order_id,positionIdorposition_idare used only when the instruction targets a known order or position.account/accountCodeandplatformare optional with the account URL; they are useful only for shared routing setups.streamIdoridcan be sent for tracking. The server keeps it in its own tracking id, preceded byTV-(17 characters at most, dashes changed to_), followed by_and 8 characters. Two alerts sent with the same id are therefore two separate alerts: the second is never treated as a duplicate. If omitted, the server creates a tracking id.tag(aliascomment) names the strategy an alert belongs to. On an entry it is written into the position's broker comment; on a close it restricts the close to the positions carrying that name, so several strategies can share one account and one symbol. It is lowercased and cut to 12 characters, and it is honoured from robot 0.0.21 onwards — below that version a tagged close is refused rather than played on another strategy's position. Send your ownstreamIdand the generated one is replaced, so the tag never reaches the position comment: leavestreamIdout when you use tags.clientRequestedAtUtc,requestedAtUtcorrequestedAtmay be sent as an informational UTC timestamp.
The same message on one line
The same order as above, written on a single line:
buy,EURUSD,risk=1,sl=0.2,tp=0.4,priceMode=percent
What not to send
Do not rely on ttl_ms: the current WebhookIngress parser does not read it. vol_lots is read as volume. Each price keeps the unit it is written in: a suffix sets the unit of that value only (sl_pips, sl_price, sl_pct, tp_pips, tp_price, tp_pct, and entry_pips, entry_price, entry_pct for the entry of a pending order); sl, tp and price without a suffix take the priceMode (or unit) written in the alert, otherwise the account price mode. The robot applies a single unit to the whole order, so an alert whose prices need two units is refused, never sent without its stop-loss or take-profit: sl_pips with tp_price, or sl without a suffix next to tp_pips (even on an account set to pips; add priceMode=pips). Put a suffix on every price, or on none. An alert that writes the same field twice with two different values is refused too (sl=10 then sl=20, or "type":"sell" with "action":"buy"); the same value twice counts once.
Alerts written for WebhookTrade
An alert in WebhookTrade's format is read as it is for symbol, action (buy_limit, sell_stop…), price, stop_loss, take_profit, size (lots) and expiration (minutes); comment names the strategy, like tag; username, api_key, broker and account_type are ignored. Of their closing actions, close_all is read as closeall; for close_buy, close_sell and close_pending, send closelong, closeshort, or cancellong and cancelshort. Their other stop, target, size, trailing and break-even parameters — sl_percentage, tp_percentage, sl_distance, tp_distance, sl_distance_price, tp_distance_price, stop_amount, profit_amount, size_percentage, risk_percentage, size_multiplier, ts_…, breakeven_… — make the alert refused, with a message naming them: played without them, the order would leave without its stop or at another size. Write them with sl / tp and priceMode, volume or risk, and betrigger / trailtrig / traildist.
Already have alerts? Keep them
You do not need to rewrite your alerts. A one-line message works as it is, even when it starts with a licence ID: in each TradingView alert, only replace the webhook URL with your own, the one that ends with your access key. The value placed before the command is then ignored, and parameter names such as sl_pips, tp_price or vol_lots are translated automatically. One exception: an alert that mixes price units (sl_pips with tp_price, for example) is now refused: write every price in the same unit.