Skip to main content
TradingView
  1. Home
  2. TradingView Tutorials
Download now
EN
  • 简体中文
  • 繁體中文
  • English
  • 한국어
  1. Home
  2. TradingView Tutorials
  3. Webhook Basics

Webhook · Advanced

What Is a TradingView Webhook? How Beginners Can Understand and Use It

July 4, 2026 · About 8 min read

When you connect alerts in TradingView to external systems, one word you will run into again and again is "webhook".

Note: This article is not investment advice. It only explains the technical role of webhooks and basic safety awareness; make your own decisions based on your own risk tolerance before using them.

What Is a TradingView Webhook?

A TradingView webhook is a way to send information to a specified URL after an alert fires.

More concretely: once you set up an alert in TradingView—such as "BTC breaks a certain price", "RSI drops below 30", or "a script signal appears"—TradingView can send the alert message you wrote in advance to an external address via an HTTP POST request when the alert triggers. Official help also notes that a webhook places the alert message in the request body when it fires; if the message is valid JSON, the request usually uses application/json, otherwise it uses text/plain.

For beginners, do not treat a webhook as an "automatic trading machine". A better first impression is: a tool for forwarding alerts, logging, and connecting workflows.

Understanding Webhooks With a Simple Analogy

You can think of a TradingView alert as a "doorbell".

  • A normal alert: the doorbell rings and your phone gets a notification.
  • A webhook: the doorbell rings, and the system not only notifies you but also delivers this structured or plain-text message to an address you specify.

Behind that address might be a Discord channel, a Telegram bot, a self-hosted log database, a dashboard, a team collaboration tool, or an internal risk-control workflow. TradingView does only one thing: when the condition is met, it throws out a POST. How it is parsed afterward, and whether a human confirms it, is entirely up to your receiving end.

So the essence of a webhook is not "making money for you", but "moving an alert from the chart into another information system".

What Can a TradingView Webhook Be Used For?

1. Discord: Shared Alerts for Research Teams

Do friends, a live-trading group, or a research community need to watch key levels together? You can webhook TradingView alerts to Discord. For example, BTC testing a resistance level, a stock breaking an observation price, or signals from a custom indicator can all be gathered into the same channel—so not everyone has to sit in front of their own chart.

Note: Discord has specific requirements for the payload format. Official docs stress that the JSON must be organized according to Discord's required fields; if you send it like a plain chat message, you usually need fields such as content to carry the text. This use case is good for information sync, not for turning it directly into unconfirmed order instructions.

2. Telegram: Lightweight Mobile Push

Many users forward webhooks to a Telegram bot via an intermediary service, getting more flexible phone alerts: symbol, price, timeframe, and trigger context can all go in the message body, and after confirming, you manually return to the chart to review.

As a beginner you do not need to build a full bot pipeline right away. First think it through: is the alert readable, and can it support you going back to the chart to make a decision?

3. Self-Hosted Logging: Trade Journals and Review

Webhooks are great as a structured logging entry point: trigger time, symbol, timeframe, price at the moment, indicator state, and custom tags can all be saved in the POST body. A few weeks later you can answer questions like "which alerts fire often but are useless" and "which assets are too noisy", so strategy adjustments are based on data rather than gut feeling.

4. Risk-Control Alerts: Slowing the Process Down

You can also connect webhooks to internal risk checks: whether you already hold a position in the same direction, whether you are near your daily max loss, whether you are around major data releases, or whether you have traded many times in a row. The goal is not to speed up impulses, but to add confirmation steps.

5. Automated Workflows: Connect Carefully, Not Mindless Trading

Advanced uses include writing to a database, triggering approvals, updating dashboards, or launching scripts. TradingView officially warns in several places that alerts are not designed for automated trading, and that you must not put login credentials, keys, or other sensitive information in the webhook URL or body. A webhook can be one link in a workflow, but it must be paired with permissions, risk control, and logging.

Risk warning: Webhook + automation without a human fallback can amplify losses when indicators repaint, when there are delays, duplicate triggers, or service failures. Build up the ability to troubleshoot ordinary alerts first, then introduce automation step by step.

What Should a TradingView Webhook Not Be Mistaken For?

Misconception 1: A Webhook Equals Automatic Profit

A webhook only delivers messages. It does not evaluate whether a strategy works, and it does not know your position, stop-loss, or emotional tolerance. A bad strategy just gets broadcast faster.

Misconception 2: A Webhook Equals Risk-Free Order Placement

A webhook itself provides no risk control. If an external system acts the moment it receives a message—without human confirmation, permission isolation, position limits, and exception handling—the risk is often higher than manual operation.

Misconception 3: A Webhook Can Replace a Trading Plan

A webhook can only answer "was the condition triggered, should a message be sent". It cannot replace your answers to key questions like "does this trade fit my system", "where does the stop go", and "what do I do if I'm wrong".

Misconception 4: Pine Script + Webhook Is a Complete System

Pine handles conditions and the webhook handles transport, but a complete loop still needs data validation, permissions, logging, auditing, human review, and a review process—otherwise it is just a bare message pipe.

The Basic Idea Behind Setting Up a TradingView Webhook

The following is a mental map of the common flow—not a guide to building an automated trading system from scratch.

  1. Start with a clear alert: Webhooks depend on alerts. First get comfortable with price alerts, then understand the differences between indicator, strategy, drawing, and Pine Script alerts; different types depend on the chart timeframe differently.
  2. Prepare a URL that can receive it: It can be provided by a Discord/Telegram intermediary, a cloud platform function, or a self-hosted service. TradingView will not build the backend for you.
  3. Enable the webhook URL in the alert: Fill in an HTTPS receiving address. For data security, official policy usually requires: webhooks can only be enabled after two-factor authentication (2FA) is turned on—refer to the in-app prompts for specifics.
  4. Write a clear message that leaks no secrets: You can format JSON placeholders based on the official variable reference so the other system can parse it at a glance. Never put account passwords or API tokens in plain text.
  5. Test the pipeline before going live: Watch whether the trigger actually happens, whether the message fields line up, whether the server responds quickly, and whether failures produce clear logs. Some error cases have a limited number of retries—your system must tolerate duplicate delivery.

Message Example (No Sensitive Fields)

{
  "symbol": "{{ticker}}",
  "price": "{{close}}",
  "time": "{{time}}",
  "alert": "Price hit a key observation level, please recheck on the chart"
}

Test Checklist (Tick Off Each Item)

  • Did the alert actually fire?
  • Is the HTTP payload complete and correctly encoded?
  • Does the JSON/text match what the receiving end expects?
  • Does the server respond within the official time limit?
  • On failure, can you locate the cause in the Alert Log / webhook status column?
  • Could duplicate delivery occur, and is your idempotency logic robust?

For more interface-level details, see the entries related to notifications, logs, and security in the TradingView alerts and webhook help.

Common Reasons a Webhook Receives No Message

  1. The alert itself did not fire: Check the TradingView alert log first; no trigger means no POST.
  2. URL typo or wrong environment: Missing characters, extra spaces, an expired webhook, an unreachable domain, or filling in localhost or an internal IP will all cause failures.
  3. The receiving end rejects the format: Some services only accept JSON and reject plain text. Platforms like Slack and Discord often require specific field names; read the other side's docs carefully.
  4. Processing takes too long: If remote processing exceeds the official time limit (often discussed as about 3 seconds), the request may be canceled; the recommended pattern is "return 200 quickly, then process asynchronously".
  5. Unsupported port or network shape: Usually only 80/443; non-standard ports may be rejected, and you should confirm whether IPv6 is supported (if the docs say it's limited, plan an IPv4 entry point).
  6. HTTP 4xx / 5xx: These mean client parameter/auth issues or a server internal error respectively; check both the TradingView-side status and your own service's access logs.
  7. Missing required authentication: If the service needs a token, signature, IP allowlist, or mTLS, you must configure it on the receiving end in advance. For HTTPS webhooks, official docs also offer a certificate-based verification approach (which must be correctly enabled on your receiving server).
  8. Limited failure retries: Some 5xx cases may retry after a few seconds, with an upper limit. Do not assume unlimited resending.

Safety Reminders: Things to Note Before Using Webhooks

  1. Never transmit passwords or API secrets in the URL or message body.
  2. Treat the webhook URL like a token: do not screenshot it to a group, commit it to a public repo, or show it for long stretches in a video.
  3. Essential server-side security baseline: HTTPS, source verification (certificate/token/IP), rate limiting, structured logging, and exception alerting.
  4. Don't let a webhook place real-money orders directly (especially for beginners); the recommended chain is "webhook → notification → logging → (optional) human confirmation".
  5. Design for duplicate delivery, missed delivery, and latency: critical actions need idempotency and compensation mechanisms.

A Reasonable Path for Beginners Using TradingView Webhooks

  1. First master native alerts: trigger conditions, frequency, logs—without these, webhooks make no sense.
  2. As a first step, only use it as a multi-device notification alternative (Discord/Telegram/self-hosted forwarding), still centered on manually reviewing the chart.
  3. As a second step, turn the webhook into structured logs or a database to support review.
  4. As a third step, introduce risk-control questions: check positions, frequency, economic-data windows, and personal rules.
  5. If you later want complex automation: sandbox drills, least privilege, an emergency kill switch, two-person review, and a complete audit trail are all indispensable—subscription capabilities and feature boundaries still follow what the TradingView subscription and billing page shows.

Summary: A Webhook Is a Connection Tool, Not a Trading Shortcut

The job of a TradingView webhook can be summed up in one sentence: "Once an alert fires, deliver one or more requests with attached messages to a specified HTTPS address."

It can connect Discord, Telegram, logging systems, dashboards, and risk control; but it does not guarantee profitability, nor does it remove your responsibility for market risk. The recommended progression is always: master alerts → webhook notifications → structured logging → risk-control enhancements → cautious automation.

FAQ

Is TradingView Webhook a free feature?

Availability and per-plan quotas may change with subscription policy; refer to the official TradingView subscription page and what your account shows. Official docs also note that, to protect data, webhooks are typically opened only after two-factor authentication is enabled.

Can a webhook post directly to Discord?

Yes, but the message must be written as JSON allowed by the Discord Webhook API—a common approach is to use fields like content to carry the text.

Why is my webhook not receiving messages?

Troubleshoot layer by layer from "did it fire" to "URL/port/response time/JSON format/authentication", and use the webhook status column in the alert log to locate the end-to-end failure point.

Can a webhook be used for automated trading?

Technically it can connect to a downstream system, but that does not mean it is officially recommended as your automation backbone; also, you must not transmit credentials in plain text through the channel.

Should a webhook message be text or JSON?

It depends on the receiver's protocol: valid JSON usually means application/json; otherwise it may be text/plain. Always read the docs first, then test for real.

← Back to tutorials

TradingView

TradingView product overview in English. Not investment advice.

On this site

  1. Home
  2. TradingView Tutorials
  3. Overview
  4. Charts
  5. Alerts
  6. Download
  7. FAQ

Disclaimer · Privacy Policy

© 2026 TradingView. Product names, trademarks, and related rights belong to their respective owners.