TradingView Webhook Alerts: Setup and Examples
On this page
Short answer: A TradingView webhook sends an HTTP POST request to a URL you choose every time an alert fires, with your alert message as the request body. You need a paid plan (webhooks start on Essential) and two-factor authentication turned on. TradingView only calls ports 80 and 443 and cancels the request if your server takes longer than three seconds to answer.
Webhooks are how traders connect TradingView alerts to bots, trade copiers, spreadsheets and chat apps. This guide covers the setup, message formats and the reasons a webhook fails.
Requirements
| Requirement | Detail |
|---|---|
| Plan | Essential or higher (Basic has no webhook notifications) |
| Security | Two-factor authentication enabled on your TradingView account |
| Ports | 80 (HTTP) or 443 (HTTPS) only; other ports are rejected |
| Response time | Your server must answer within 3 seconds or the request is cancelled |
| IP version | IPv4 only; IPv6 is not supported for webhooks |
Sources: TradingView webhook guide and pricing page, checked October 2026.
How to set up a webhook alert
- Turn on two-factor authentication in your TradingView account settings. Without it, the webhook option stays unavailable.
- Get the URL you want to call. This is the endpoint of your bot, automation service or chat app. It must start with http:// on port 80 or https:// on port 443.
- Create the alert as usual (Alt + A, or the Alert button) and set the condition, trigger and expiration. Our step-by-step alert guide explains each field.
- Write the message. Whatever you type in the Message field becomes the body of the POST request.
- Enable Webhook URL in the Notifications section and paste your URL.
- Create the alert, then send a test by setting a condition that will fire soon, or point the URL at a request-inspection service first to see exactly what arrives.
Message format: JSON or plain text
TradingView checks your message. If it is valid JSON, the request is sent with the content type application/json. Otherwise it is sent as text/plain. Check what your receiving app expects; many, including Slack, expect JSON.
A plain-text message:
BTCUSD Greater Than 9000A JSON message for a bot, using TradingView placeholders that are filled in when the alert fires:
{
"symbol": "{{ticker}}",
"exchange": "{{exchange}}",
"price": "{{close}}",
"interval": "{{interval}}",
"time": "{{timenow}}",
"action": "buy"
}Placeholders such as {{ticker}}, {{close}} and {{timenow}} are documented in TradingView's Pine Script alert guide. If one quote or comma is missing, the message is no longer valid JSON and arrives as plain text, which many bots reject. Validate the JSON before saving the alert.
Never put passwords or API keys in the message. TradingView's own guide warns against sending sensitive data in the webhook body. Use a receiving service that authenticates requests in another way.
Allowlisting TradingView's IP addresses
If your server only accepts known senders, TradingView lists these source addresses for webhook requests:
| TradingView webhook IPs |
|---|
| 52.89.214.238 |
| 34.212.75.30 |
| 54.218.53.128 |
| 52.32.178.7 |
TradingView can change these, so recheck the official guide if deliveries suddenly stop.
Why a webhook fails
| Symptom | Likely cause | Fix |
|---|---|---|
| No webhook option in the dialog | Basic plan, or 2FA is off | Upgrade to Essential or higher and enable 2FA |
| Alert fires but nothing arrives | Wrong port, IPv6-only server, or firewall blocking TradingView's IPs | Use port 80/443, IPv4, and allowlist the four IPs |
| Request cancelled | Server took more than 3 seconds to respond | Reply immediately and process the order afterwards |
| Bot rejects the message | Invalid JSON sent as plain text | Validate the JSON; check quotes and commas |
| Old values in the message | Alert created before the script or indicator changed | Delete and recreate the alert |
The alert log shows a Webhook status for each delivery. Check it before changing anything else. TradingView notes that webhooks can occasionally fail to reach the URL even when everything is set up correctly, so don't build a system that breaks if one message is missed.
Using webhooks for automated trading
A common setup is TradingView alert → webhook → a bridge service → your broker or exchange. Keep a few rules in mind:
- Test with tiny size or a demo account first. A wrong field name can turn a sell into a buy.
- Use Once per bar close for strategy signals unless you deliberately want intrabar entries. See why alerts fire mid-bar.
- Log every request on the receiving side so you can match it with TradingView's alert log.
- Plan for missed messages. Have a manual check or a stop-loss at the broker, not only in TradingView.
Automation removes the delay of clicking, not the risk of the strategy.
FAQ
Are TradingView webhooks free?
No. Webhook notifications are not included in the free Basic plan; they start on Essential.
Why can't I see the webhook option?
Either your plan doesn't include webhooks or two-factor authentication is not enabled on your account.
Can I send a webhook to a custom port like 8080?
No. TradingView only sends webhooks to ports 80 and 443.
Does TradingView retry a failed webhook?
TradingView's guide says requests that take longer than three seconds are cancelled and that webhooks can occasionally fail. It does not promise retries, so design your receiver as if a message can be lost.
Keep learning
- How to set alerts on TradingView (step by step)
- TradingView alert not triggering? 9 causes, fixed
- Pine Script alertcondition() with examples
Last checked against TradingView's official pages: October 2026. Nothing here is financial advice.