TradingView Webhooks: Automate Alerts to Discord, Slack & More

Send TradingView alerts anywhere with webhooks. Step-by-step setup to forward TradingView webhook alerts to Discord, Slack, email or a trading API — with payload formatting and transformations.

TradingView is the charting and alerting platform most traders live in. Its webhook alerts let you push a notification to any URL the moment a condition triggers — a price cross, an indicator signal, a strategy entry. The catch: TradingView sends a plain message to one URL, and most destinations (Discord, Slack, your own API) expect a specific payload shape.

Webhook Relay sits in the middle: it receives the TradingView alert, reshapes it for the destination, and can fan it out to several places at once.

What you'll build

TradingView alert → Webhook Relay (transform) → Discord / Slack / email / trading API.

You need a paid TradingView plan (webhooks aren't on the free tier) and a free Webhook Relay account.

1. Get your destination URL (Discord example)

In Discord, open Server Settings → Integrations → Webhooks → New Webhook, copy the webhook URL.

Create discord webhook

2. Create a Webhook Relay endpoint

Open the new public destination page and add the Discord URL as the destination:

Create a new public forwarding configuration

Copy the input URL Webhook Relay gives you — that's what goes into TradingView.

Discord webhook URL goes into the public URL as the destination

3. Transform the payload for the destination

TradingView posts your alert message as the body, but Discord expects { "content": "..." }. Add a small transformation. Click Transform on the input:

Transform input

Open the Functions page, create a function "from scratch", and paste:

local json = require("json")

local new_body = {
    content = r.RequestBody,
}

local encoded_payload, err = json.encode(new_body)
if err then error(err) end

r:SetRequestHeader("content-type", "application/json")
r:SetRequestMethod("POST")
r:SetRequestBody(encoded_payload)

This wraps the raw alert into Discord's format. You can add any logic here — parse fields, add emojis, route by ticker, or drop alerts that don't matter.

4. Create the TradingView alert

In TradingView, create an alert (here, BTC price — but it works for NVDA, the S&P, or any symbol):

Creating an alert

In the alert dialog, enable Webhook URL and paste your Webhook Relay input URL. In the Message field, write whatever you want delivered. You can use TradingView placeholders to include live values:

{{ticker}} crossed {{close}} at {{time}} — signal: {{strategy.order.action}}

Send a test and the alert lands in Discord:

Discord message

Send the same alert elsewhere

The same pattern works for any destination — only the transform changes:

  • Slack: wrap the message as { "text": "..." } and use your Slack incoming webhook as the destination. See transforming webhooks.
  • Email: send the alert as an email from the function.
  • Multiple destinations at once: add several outputs so one alert hits Discord, Slack and email together — see forward to multiple destinations.
  • Your trading API / broker: call any HTTP endpoint from the function to place an order. Test carefully before automating live trades.

Formatting tip: send JSON from TradingView

Instead of plain text, you can put JSON directly in the alert message so your function gets structured fields:

{"ticker": "{{ticker}}", "action": "{{strategy.order.action}}", "price": {{close}}}

Then parse it in the transform and build a rich Discord/Slack message or an API call.

Troubleshooting

  • Alert fires but nothing arrives: confirm the webhook URL is the Webhook Relay input URL, and check the request log in your dashboard.
  • Discord/Slack rejects the message: the body isn't in the expected shape — add or fix the transform.
  • Webhook option greyed out: webhooks require a paid TradingView plan.

Next steps

Create a free account to set this up, or inspect a TradingView alert payload first to see exactly what it sends.