Setting up TradingView Webhooks
Use your own TradingView Pine Script strategy and let Hextrade automatically execute orders on your connected broker accounts. No code changes required on your broker side — just set the webhook URL and use the correct JSON format.Supported Platforms for Webhooks
ProjectX
Futures trading on ProjectX via TradingView webhook.
Tradovate
Futures on Tradovate. Set
platformType to tradovate.Alpaca
Equities on Alpaca. Set
platformType to alpaca.DxTrade
Multi-asset via DxTrade. Set
platformType to dxtrade.Tradier
Equities and options via Tradier. Set
platformType to tradier.More coming
Additional platforms added regularly. Check Discord for updates.
TradingView Webhook JSON Format
When creating a TradingView alert, use the following JSON in the alert message. Hextrade will parse this and place the corresponding order on your connected broker.tp (Take Profit) and sl (Stop Loss) values are calculated in ticks, not dollars. Ensure these match your instrument’s tick size.️ Field Mapping: TradingView → Hextrade API
| TradingView Field | Hextrade API Field | Description |
|---|---|---|
ticker | symbol | The instrument symbol (e.g. NQ, ES, AAPL) |
action | side | Order side — buy or sell |
sentiment | sentiment | Market position (long, short, flat) |
quantity | quantity | Number of contracts or shares |
price | price | Entry price (use {{close}} for market) |
tp | tp | Take profit in ticks |
sl | sl | Stop loss in ticks |
Required Fields
Every webhook payload must include:| Field | Description |
|---|---|
platformType | The broker — projectx, tradovate, alpaca, dxtrade, tradier, etc. |
accountId | Your account ID from the Accounts page. |
symbol or ticker | The instrument to trade. |
quantity | Number of contracts or shares. |
side or action | buy or sell. |
Setting Up the Webhook in TradingView
Get your Webhook URL
Visit dash.hextrade.io/accounts and open the Webhooks section.Copy your unique Hextrade webhook URL — it looks like:
Open your Pine Script strategy in TradingView
In TradingView, open the chart where your strategy is applied. Click “Add Alert” (or right-click → Add Alert).
Configure the alert
- Condition — Select your strategy and the trigger condition (e.g.
strategy.order.action). - Webhook URL — Paste your Hextrade webhook URL.
- Message — Paste the JSON payload (from the template above). Replace
your_account_idwith your actual account ID from the Accounts page.
Customize the JSON for your instrument
Adjust the following fields:
"platformType"— Set to your broker (e.g."projectx","alpaca")."accountId"— Your account ID."ticker"— Your instrument (e.g."NQ","ES","AAPL")."tp"and"sl"— Take profit and stop loss in ticks (optional).
Example Payloads
ProjectX — NQ Futures
Alpaca — AAPL Equities
Tradovate — ES Futures
Troubleshooting
| Issue | Solution |
|---|---|
| Webhook fires but no order placed | Check accountId — must match exactly from the Accounts page. |
platformType error | Use lowercase: projectx, tradovate, alpaca, dxtrade, tradier. |
tp/sl not working | These are in ticks, not dollars. Verify tick size for your instrument. |
| Alert not triggering | Ensure the TradingView alert is active and the strategy is on the chart. |
| Order rejected by broker | Check account balance, position limits, and broker-side trading hours. |
Security
- Your webhook URL contains a unique token — keep it private.
- Do not share your webhook URL publicly (e.g. in Discord or GitHub).
- If compromised, regenerate your token from the Accounts page.