Skip to main content
All articles

TradingView Alerts to Discord (Webhook Setup Guide)

Send TradingView alerts to a Discord channel with webhooks. Step-by-step setup, valid JSON message format, dynamic placeholders, embeds, and common error fixes.

tradingviewtradingview discord webhooktradingview alerts discordtrading alertstradingview webhook 2026webhook automation

🇷🇺 Also available in Русский

TradingView Alerts to Discord (Webhook Setup Guide)

Why Route TradingView Alerts to Discord?

TradingView’s alerts are powerful, but by default they only show up as pop-ups, emails, or app notifications. Sending them to a Discord channel gives you a shared, timestamped feed your whole trading group can watch — entries, exits, indicator crosses, and strategy signals, all in one place.

TradingView can fire a webhook when an alert triggers, and Discord accepts webhooks natively. The catch: TradingView sends the alert message exactly as you type it, so the message must be valid Discord JSON. This guide walks through the setup and the formatting that trips most people up.

Requirements

  • A paid TradingView plan (Essential, Plus, or Premium). Webhook alerts are not available on the free tier.
  • Two-factor authentication enabled on your TradingView account — TradingView requires 2FA before it will let you add webhook URLs.
  • A Discord webhook URL. Create one in Server Settings → Integrations → Webhooks → New Webhook → Copy Webhook URL. New to webhooks? See the setup guide.

Step 1: Add the Webhook to Your Alert

  1. Open a chart and click the Alert button (the alarm-clock icon) or press Alt + A.
  2. Configure your condition (indicator cross, price level, strategy signal, etc.).
  3. Scroll to the Notifications tab of the alert dialog.
  4. Tick Webhook URL and paste your Discord webhook URL.

TradingView will send a POST request to that URL the moment the alert fires.

Step 2: Format the Message as Discord JSON

This is the critical step. In the alert’s Message box, do not type a plain sentence. Discord ignores raw text from a webhook — it expects JSON. The simplest valid message is:

{ "content": "BUY signal triggered" }

That single line posts “BUY signal triggered” to your channel. If you paste a plain sentence instead, Discord rejects it with a 400 Bad Request and nothing appears.

Step 3: Insert Dynamic Values with Placeholders

TradingView replaces {{...}} placeholders with live values before sending. Put them inside the JSON string:

{ "content": "{{strategy.order.action}} {{ticker}} @ {{close}} — {{interval}} chart" }

A triggered alert might post:

buy BTCUSDT @ 64210.5 — 15 chart

Useful placeholders:

PlaceholderValue
{{ticker}}Symbol, e.g. BTCUSDT
{{exchange}}Exchange, e.g. BINANCE
{{close}}Closing price of the trigger bar
{{open}} {{high}} {{low}}OHLC values
{{volume}}Bar volume
{{interval}}Chart timeframe
{{time}}Bar time (UTC)
{{strategy.order.action}}buy or sell (strategy alerts)
{{strategy.position_size}}Current position size

Watch your quotes. Everything inside the JSON must stay valid after substitution. Wrap text values in double quotes and avoid placeholders that could contain a stray " — a broken string becomes invalid JSON and Discord returns a 400.

Step 4: Send a Rich Embed Instead of Plain Text

Plain content works, but an embed with a title, color, and fields reads far better for trade signals. Paste a full embed object as the message:

{
  "embeds": [
    {
      "title": "{{strategy.order.action}} {{ticker}}",
      "color": 5763719,
      "fields": [
        { "name": "Price", "value": "{{close}}", "inline": true },
        { "name": "Exchange", "value": "{{exchange}}", "inline": true },
        { "name": "Timeframe", "value": "{{interval}}", "inline": true }
      ],
      "footer": { "text": "TradingView Alert" }
    }
  ]
}

Use green (5763719) for buys and red (15548997) for sells. The cleanest way to build the layout is to design it in the free Discord Webhook Builder, copy the generated JSON, then drop your {{placeholders}} into the field values.

Tip for buy/sell colors: TradingView sends the exact message you saved, so it cannot pick the color dynamically. Create two alerts — one for the buy condition with a green embed, one for the sell condition with a red embed.

Step 5: Pine Script alert() Messages

If you generate signals from a Pine Script strategy, you can build the JSON directly in code and pass it to alert():

//@version=5
strategy("Discord Signal", overlay=true)

longCondition = ta.crossover(ta.sma(close, 10), ta.sma(close, 30))
if longCondition
    strategy.entry("Long", strategy.long)
    alert('{"content": "LONG ' + syminfo.ticker + ' @ ' + str.tostring(close) + '"}', alert.freq_once_per_bar_close)

Set the alert condition to “Any alert() function call” and leave the alert message empty — the JSON comes from the script. Use alert.freq_once_per_bar_close to avoid repaint-driven duplicate signals.

Step 6: Mention a Role on Important Signals

To ping a role when a high-priority signal fires, include the role ID and an allowed_mentions block so the ping actually notifies. See the full mentions guide:

{
  "content": "<@&ROLE_ID> {{strategy.order.action}} {{ticker}} @ {{close}}",
  "allowed_mentions": { "parse": ["roles"] }
}

Troubleshooting

ProblemCause & Fix
Nothing posts, alert shows “sent”Message isn’t valid JSON. Test it with the error guide and a JSON validator.
400 Bad Request in TradingView logsA placeholder broke the JSON, or content exceeds 2000 chars / embed limits.
Can’t add a webhook URLEnable 2FA on your TradingView account and confirm you’re on a paid plan.
Duplicate signalsUse alert.freq_once_per_bar_close in Pine, or set the alert to “Once Per Bar Close”.
Webhook stopped working after monthsThe webhook may have been deleted/regenerated in Discord — paste a fresh URL.

Rate Limits

A Discord webhook accepts about 30 requests per minute. High-frequency scalping alerts on multiple symbols can hit this and return 429. If you alert on many tickers, route different symbol groups to separate webhooks in different channels.

Next Steps

You can now stream TradingView signals straight into Discord with clean, color-coded embeds. Design your alert layout visually in the Discord Webhook Builder, then paste the JSON into TradingView with your {{placeholders}}. For broader automation patterns, see webhook notifications and automation.