TradingView alerts
Same idea as TradingView’s webhook help: you paste a Webhook URL and a Message. TradingView POSTs that message to the URL. No custom headers. No script edit.
Do not put the secret in the Message. Keep it on the URL (?key=). TradingView also warns against putting credentials in the webhook body.
You need
- Dhan connected
- A strategy webhook
- TradePod on a public host (not
localhost) - TradingView 2-factor authentication on (required for webhooks)
Two copy-paste pieces
| Where in TradingView | What to paste |
|---|---|
| Notifications → Webhook URL | Full URL from TradePod Config (already has ?key=) |
| Message | Entry JSON or Exit JSON below — no "key" field |
If the Message is valid JSON, TradingView sends application/json. TradePod accepts that.
Step 1 — Copy from TradePod
Strategy → Config:
- Copy Options
/opt, Futures/fut, or Equity/eq(or Normal). - Copy Entry (BUY) and Exit messages.
Step 2 — Create two alerts
One alert for entry, a second alert for exit (different condition).
- Chart → Add alert.
- Set the condition.
- Notifications → enable Webhook URL → paste the TradePod URL.
- Message → paste Entry or Exit JSON.
- Prefer Once Per Bar Close.
- Create the alert.
{{ticker}} and {{close}} are filled by TradingView. Keep {{close}} without quotes so price stays a number.
Entry
{
"action": "BUY",
"symbol": "{{ticker}}",
"price": {{close}}
}
For a short, use "SELL" instead of "BUY". Size, stop, and target come from strategy Settings unless you add extra fields later.
Exit
Same webhook URL. Different Message. Closes the open trade for that symbol.
{
"action": "EXIT",
"symbol": "{{ticker}}",
"price": {{close}}
}
Entry and Exit stay separate alerts so they stay intact.
Identical entry or exit JSON for the same strategy is ignored for about 1 hour.
:::tip Brackets (SL / target / trail)
If you send sl, TradePod places a Super Order even when Settings order mode is MARKET (Dhan Super entry is LIMIT). trail_sl is points (₹) and needs sl. target / trail_sl without sl returns an error — omit them for a plain entry.
:::
Optional extras (SL, target, trail)
Only add these if you want them. Leaving them out is fine — TradePod uses strategy Settings. Do not send order_mode / qty / lots unless you mean to override.
{
"action": "BUY",
"symbol": "{{ticker}}",
"price": {{close}},
"sl": {{plot("SL")}},
"target": {{plot("Target")}}
}
| Extra | Field | If missing / 0 |
|---|---|---|
| Stop | sl | No SL from alert |
| Target | target | No target from alert |
| Trail | trail_sl | Price jump in points (₹), not %. Needs sl. Omit / 0 = no trail |
| Later change | MODIFY | Own alert |
| Flatten | FORCE_EXIT | Own alert |
Pine helpers (omit when 0): Pine Script & extras · download tradepod-webhook.pine
Common problems
| Problem | What to check |
|---|---|
| Nothing happens | Public host? Full URL with ?key=? Auto-Execute on? |
| 401 | Re-copy the Webhook URL from Config |
| Invalid JSON | Quotes around {{close}} |
| Same entry ignored | Same JSON already sent in the last hour |