Skip to main content

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​

  1. Dhan connected
  2. A strategy webhook
  3. TradePod on a public host (not localhost)
  4. TradingView 2-factor authentication on (required for webhooks)

Two copy-paste pieces​

Where in TradingViewWhat to paste
Notifications → Webhook URLFull URL from TradePod Config (already has ?key=)
MessageEntry 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:

  1. Copy Options /opt, Futures /fut, or Equity /eq (or Normal).
  2. Copy Entry (BUY) and Exit messages.

Step 2 — Create two alerts​

One alert for entry, a second alert for exit (different condition).

  1. Chart → Add alert.
  2. Set the condition.
  3. Notifications → enable Webhook URL → paste the TradePod URL.
  4. Message → paste Entry or Exit JSON.
  5. Prefer Once Per Bar Close.
  6. Create the alert.
tip

{{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")}}
}
ExtraFieldIf missing / 0
StopslNo SL from alert
TargettargetNo target from alert
Trailtrail_slPrice jump in points (₹), not %. Needs sl. Omit / 0 = no trail
Later changeMODIFYOwn alert
FlattenFORCE_EXITOwn alert

Pine helpers (omit when 0): Pine Script & extras · download tradepod-webhook.pine

Common problems​

ProblemWhat to check
Nothing happensPublic host? Full URL with ?key=? Auto-Execute on?
401Re-copy the Webhook URL from Config
Invalid JSONQuotes around {{close}}
Same entry ignoredSame JSON already sent in the last hour

Whitelist Static IP · Authentication