TradingView to CrossTrade webhook JSON
CrossTrade takes a flat JSON object as well as its key=value; text. Build the JSON and check it against CrossTrade's own rules as you type: one flat object, no empty values, and every field a place order needs.
Updated 23 October 2026. Runs in your browser; nothing you type is uploaded.
Send to
Alert from
Placeholders for any alert
Strategy alerts only
Text placeholders go in quotes; a placeholder added outside a string comes with them.
CrossTrade, strategy alert
Valid JSON: TradingView sends it as application/json
0 errors, 1 thing to check. This is the CrossTrade preset for a strategy.
- YOUR_SECRET_KEY is still a stand-inCheck
Replace it with your own value before you create the alert.
What CrossTrade receives
Content-Type: application/json, with sample values in place of the placeholders.
{
"key": "YOUR_SECRET_KEY",
"command": "place",
"account": "Sim101",
"instrument": "ES1!",
"action": "buy",
"qty": "2",
"order_type": "market",
"tif": "day"
}Where it goes
- Webhook URL
https://app.crosstrade.io/v1/send/YOUR_UID/YOUR_CHANNELCopy the complete URL from your CrossTrade account.- The secret
- In the message: "key" carries your Secret Key. The URL is your own endpoint.
- CrossTrade reads a body that starts with { as JSON (since 21 September 2026) and anything else as its key=value; text; both go to the same URL.
- The JSON is one flat object, with no nesting, arrays, nulls or empty values. A place needs account, instrument, action, qty and order_type, plus tif on NinjaTrader.
- A rejected request still gets HTTP 200, with an error in the body, so check CrossTrade's log rather than TradingView's.
From CrossTrade's docs, read 23 October 2026: JSON format, webhook trading, TradingView placeholders.
Or build it in Pine, so the JSON is never inside other JSON
In the alert: Order fills only, and nothing but {{strategy.order.alert_message}} in the Message box. Each order passes the whole message as alert_message, with its own buy or sell.
//@version=6
strategy("Webhook message", overlay = true)
// Your own rules go here; this example crosses two averages.
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
qty = 1
// The whole message, built here. In the alert: Order fills only, and nothing but
// {{strategy.order.alert_message}} in the Message box.
webhookMessage(string action, string id, string position) =>
string m = '{'
m += '"key": "YOUR_SECRET_KEY",'
m += '"command": "place",'
m += '"account": "Sim101",'
m += '"instrument": "ES1!",'
m += '"action": "' + action + '",'
m += '"qty": "' + str.tostring(qty) + '",'
m += '"order_type": "market",'
m += '"tif": "day"'
m += '}'
m
if ta.crossover(fast, slow)
strategy.entry("Long", strategy.long, qty, alert_message = webhookMessage("buy", "Long", "long"))
if ta.crossunder(fast, slow)
strategy.entry("Short", strategy.short, qty, alert_message = webhookMessage("sell", "Short", "short"))
The code for every preset compiles on TradingView with no errors or warnings. Put your own entry rules in place of the two averages, then check the script for repaint risks.
What CrossTrade reads
- Format
- JSON; it needs "key", "command".
- Webhook URL
https://app.crosstrade.io/v1/send/YOUR_UID/YOUR_CHANNELCopy the complete URL from your CrossTrade account.- The secret
- In the message: "key" carries your Secret Key. The URL is your own endpoint.
- CrossTrade reads a body that starts with { as JSON (since 21 September 2026) and anything else as its key=value; text; both go to the same URL.
- The JSON is one flat object, with no nesting, arrays, nulls or empty values. A place needs account, instrument, action, qty and order_type, plus tif on NinjaTrader.
- A rejected request still gets HTTP 200, with an error in the body, so check CrossTrade's log rather than TradingView's.
The two starting messages
{
"key": "YOUR_SECRET_KEY",
"command": "place",
"account": "Sim101",
"instrument": "ES1!",
"action": "{{strategy.order.action}}",
"qty": "{{strategy.order.contracts}}",
"order_type": "market",
"tif": "day"
}{
"key": "YOUR_SECRET_KEY",
"command": "place",
"account": "Sim101",
"instrument": "ES1!",
"action": "buy",
"qty": 1,
"order_type": "market",
"tif": "day"
}From CrossTrade's own docs, read 23 October 2026: JSON format, webhook trading, TradingView placeholders.
TradingView's side of a webhook
- Plan and 2FA
- Webhook notifications are on Essential, Plus, Premium, Ultimate, not on the free Basic plan (pricing table), and webhook alerts are allowed only with two-factor authentication turned on.
- Content-Type
- application/json when the message is valid JSON, text/plain otherwise. TradingView sends a POST with the message as the body.
- IP addresses to allowlist
52.89.214.238,34.212.75.30,54.218.53.128,52.32.178.7. Over HTTPS TradingView also sends a client certificate for webhook-server@tradingview.com (webhook authentication).- Ports, IPv6 and time
- Ports 80 and 443 only; no IPv6; no localhost or private addresses. A request your server takes more than three seconds to answer is cancelled, and a 500 to 599 answer other than 504 is sent again after 5 seconds, up to 3 times (resubmission).
- Message length
- 4,000 characters in the alert's Message box; 40,960 from alert() or alert_message. The body has the same limits, and an emoji counts as several characters (size limits).
- Secrets
- TradingView asks you not to put login credentials or passwords in the webhook URL or message (credentials for webhooks).
From TradingView's How to configure webhook alerts and the pages linked above, read 23 October 2026.
Other receivers
- TradingView to TradersPost webhook JSON JSON with ticker and action; the password is in the webhook URL.
- TradingView to PineConnector alert message Comma-separated text, not JSON; the License ID leads the message.
- TradingView to 3Commas Signal Bot JSON v2 Signal Bot JSON; the v1 secret and bot_uuid format is retired.
- TradingView to Discord webhook JSON JSON with content or embeds; the token is in the webhook URL.
- TradingView to Telegram webhook JSON JSON with chat_id and text; the bot token is in the URL.
- Custom JSON for your own server and TradingView's placeholders in full.
Common questions
Does CrossTrade accept JSON from TradingView?
Yes, since 21 September 2026. A body that starts with { is read as JSON and anything else as the key=value; format, at the same webhook URL. The JSON is one flat object with CrossTrade's own field names: no nested objects, arrays, nulls or empty values.
What fields does a CrossTrade place order need?
key and command, then account, instrument, action, qty and order_type, plus tif on NinjaTrader. A limit order also needs limit_price, and a stop market order needs stop_price.
Why does a CrossTrade alert show as delivered but place no trade?
CrossTrade answers a rejected request with HTTP 200 and an error in the body, so TradingView's alert log can show a delivery for an order that never went through. Check CrossTrade's own log.
Alerts that already send the message
- Signal Desk Premium A Pine v6 desk whose alerts write the message for you, as ticket text, JSON, TradersPost or PineConnector, with a Discord and Telegram relay. $49 once.
- Pine Fixer An AI skill pack for 45 compiler-verified Pine v6 failure classes, with a repaint clinic. $9.99 once.