TradingView webhooks
Set up TradingView webhook automation with Hextrade. Send Pine Script alerts to a private webhook URL and execute on Tradovate, ProjectX, NinjaTrader, Rithmic, and more.
TradingView webhook automation lets you keep researching in TradingView while Hextrade places the order. Send a Pine Script strategy alert to your private webhook URL; Hextrade executes on the broker account named in the payload.
Related: TradingView FAQ · algorithmic trading on the website
Webhook platforms
Set platformType to the lowercase value.
| Platform | platformType |
|---|---|
projectx | |
tradovate | |
ninjatrader | |
rithmic | |
tradelocker | |
matchtrader | |
volumetrica | |
mt5 | |
oanda | |
hyperliquid | |
plus500 |
Payload template
Paste this into the TradingView alert message:
{
"ticker": "NQ",
"action": "{{strategy.order.action}}",
"sentiment": "{{strategy.market_position}}",
"quantity": "{{strategy.order.contracts}}",
"price": "{{close}}",
"platformType": "projectx",
"accountId": "your_account_id",
"tp": "100",
"sl": "20"
}
Note
Required fields
| Field | Description |
|---|---|
platformType | Broker slug from the table above |
accountId | Exact ID from Accounts |
symbol or ticker | Instrument |
quantity | Contracts or shares |
side or action | buy or sell |
Optional fields
| Field | Purpose |
|---|---|
strategyName / alertName | Label in logs |
note / tags | Notes and filters |
dryRun | Validate only — no order |
maxQty | Hard cap on size |
cooldown | Seconds before another fill on the same account + symbol |
session / sessionTimezone | RTH = 09:30–16:00, ETH = outside that window |
tradeWindow | Custom days and times (timezone, days, start, end) |
allowedSymbols | Whitelist |
symbolOverride | Send a different symbol than ticker |
maxTradesPerDay | In-memory cap; resets on process restart |
comment / timeInForce / slippage | Passed to the broker when supported |
callbackUrl | POST after success or failure |
cooldown and maxTradesPerDay are in-memory. dryRun: true returns HTTP 200 with the planned trade and does not update those counters.
Set it up in TradingView
- 1
Copy your webhook URL
On Accounts open Webhooks. It looks like
https://api.hextrade.io/webhook/your-unique-token. - 2
Add an alert
On the chart with your strategy, click Add Alert.
- 3
Paste URL and JSON
Condition = your strategy. Webhook URL = the Hextrade URL. Message = the payload. Replace
your_account_id. - 4
Set platform and ticker
platformType,accountId,ticker, and optionaltp/sl. - 5
Test small
Start with 1 micro contract before you scale.
Example payloads
{
"ticker": "MNQ",
"action": "{{strategy.order.action}}",
"sentiment": "{{strategy.market_position}}",
"quantity": "{{strategy.order.contracts}}",
"price": "{{close}}",
"platformType": "rithmic",
"accountId": "your_account_id",
"tp": "80",
"sl": "20"
}
{
"ticker": "ES",
"action": "{{strategy.order.action}}",
"sentiment": "{{strategy.market_position}}",
"quantity": "{{strategy.order.contracts}}",
"price": "{{close}}",
"platformType": "tradovate",
"accountId": "your_account_id",
"tp": "50",
"sl": "15"
}
Troubleshooting
| Issue | Fix |
|---|---|
| Alert fires, no order | accountId must match Accounts exactly |
platformType error | Use lowercase slugs |
tp / sl ignored | Values are ticks |
| Alert never fires | Alert must be active and the strategy must be on the chart |
| Broker reject | Balance, limits, or session hours |
Warning
TradingView can delay delivery by a few seconds. Watch the first live fills. Keep the webhook URL private — regenerate it on Accounts if it leaks.