Skip to content

Guide

How to send TradingView alerts to Discord

Create a webhook in a Discord server you run, paste its URL into the TradingView alert's Webhook URL field, and write the message as JSON. Each alert then posts to the channel. Webhooks need a paid TradingView plan. Here is the setup in five steps, what to test, and how to turn those posts into broker orders.

Set it up in five steps

  1. 1

    Create a Discord webhook for the channel

    In Discord, open Server Settings, then Integrations, then Webhooks. Select New Webhook, pick the channel that will receive the alerts, and copy the webhook URL. Keep it private: anyone with it can post to that channel.

  2. 2

    Open the alert in TradingView

    On the chart, create a new alert or edit an existing one. On the Notifications tab, check the Webhook URL box and paste the Discord webhook URL. TradingView will POST the message to that URL each time the alert fires.

  3. 3

    Write the alert message

    Discord accepts JSON only, so write the Message as JSON with a content key: {"content": "Buy {{ticker}} at {{close}}"}. TradingView fills in {{ticker}}, {{close}} and {{time}} when the alert fires and sends valid JSON as JSON. Discord posts the content line in the channel.

  4. 4

    Test with a condition that fires now

    Set a condition that fires against the current price, save the alert, and check the channel. If nothing arrives, check the webhook URL and the JSON: Discord drops a plain-text message. Webhooks need a paid TradingView plan with two-factor sign-in on.

  5. 5

    Auto-trade the channel with Nyria

    Invite the Nyria bot to the server and make the channel a strategy's alert source. Your bot places an order at your broker for each post, however it's worded. Publish the strategy and members can run their own bots on it, each on their own broker account.

TradingView sends one POST per alert fire. If the condition fires on every bar, the channel fills fast. Set the condition to fire once per bar, or use an alert with a reset period.

What TradingView sends

TradingView posts the Message field to the URL you give it. A message that is valid JSON goes out as JSON; anything else goes out as plain text. Discord's webhook reads JSON only and posts its content value, so a plain-text message never reaches the channel.

Nyria's webhook URL is a strategy's own address, and it reads plain text or JSON. Use it when the goal is placing orders. Each TradingView alert sends to one URL, so to post to Discord and trade too, trade the Discord channel as below or set up two alerts.

From Discord posts to broker orders

Once alerts arrive in a Discord channel, a Nyria strategy pointed at that channel reads each post and places an order. Connect a broker, create a strategy with the Discord channel as the source, deploy a paper bot, and verify the fills in the Logs tab before going live. Members of a server you run can each run their own bot on their own broker account.

Nyria reads a channel on a server where its bot is invited and has the Read Messages permission. You need Manage Server to invite the bot. It reads only the channel you pick, nothing else.

Questions

Do I need a TradingView paid plan to send to Discord?
Yes. TradingView sends webhooks on its paid plans only, with two-factor sign-in turned on. The free plan can't send them.
What format does the Discord webhook expect?
JSON with a content key, such as {"content": "Buy {{ticker}} at {{close}}"}. TradingView sends a message that is valid JSON as JSON, and Discord posts the content line. A plain-text message has no content key, so Discord rejects it and nothing appears.
Can Nyria auto-execute the alerts that land in Discord?
Yes. Make the channel a Nyria strategy's alert source. Each post becomes an order at your broker, in whatever wording the post uses. Run it on paper first.
Will TradingView send duplicate alerts?
It can, when the condition is met more than once in a bar. Set the alert to trigger Once Per Bar Close and each bar posts at most one message.
Can I send alerts from multiple charts to the same channel?
Yes. Paste the same webhook URL on each alert. All of them post to the same channel.

Auto-trade the alerts from your channel

Paper is free. Live trading from $15 a month.