How to Set Up a TradingView Webhook Alert (Step-by-Step)
TradingView webhook alerts let you send a signal from your chart straight to another app the moment your strategy or indicator triggers a condition. No manual watching, no missed entries. This guide covers exactly how to set one up, plus the mistakes that trip most people up the first time.
What you need before you start
Webhook alerts require a TradingView plan of Essential or higher. The free plan does not support webhooks. You also need a destination for the webhook: a URL that can receive a POST request and do something with it. That could be a service like Chart Grader, a Discord webhook, a Zapier automation, or your own server.
Step 1: Build or open your alert condition
Webhooks fire off a TradingView alert, so the condition is whatever you would normally set an alert on: a price level, an indicator crossover, or a custom condition from a Pine Script strategy or indicator. If you are using a Pine Script strategy, calling alert() inside your script gives you full control over what gets sent, including real computed values like your stop loss and take profit.
Step 2: Right-click the chart and choose Add Alert
Set your condition, choose how often it should trigger (once per bar close is usually the safest choice to avoid repainting issues), and give the alert a name you will recognize later.
Step 3: Turn on the Webhook URL under Notifications
In the alert creation window, open the Notifications tab and toggle on Webhook URL. Paste in the destination URL. This is the only field that matters for automation. Email and popup notifications are optional extras, not required for the webhook to work.
Step 4: Write the alert message
This is where most setups go wrong. If you use alertcondition(), the message field only supports fixed placeholders like {{close}}, {{ticker}}, and {{time}}. It cannot include values your script computed, like a calculated stop loss. If you need real computed values in the payload, use the alert() function instead, which lets you build a fully dynamic message string, including proper JSON.
A typical JSON message looks like this: {"action":"buy","symbol":"{{ticker}}","price":{{close}},"time":"{{time}}"}. Keep the whole message on a single line. Breaking a JSON string across multiple lines in Pine Script is a common cause of confusing compile errors.
Step 5: Test it before you trust it
Do not wait for a real signal to find out if your webhook works. Use a tool like a request bin, or simply point the alert at an endpoint you control and check the logs. If you are connecting to Chart Grader, you can fire a manual test payload at your webhook URL and confirm it shows up in your journal before relying on it live.
Common mistakes to avoid
Smart quotes from copying text out of a word processor or chat app will break JSON silently. Type quotes directly or paste into a plain text editor first. A payload that is valid-looking JSON but uses single quotes instead of double quotes will also fail most parsers. And remember that once per bar close means the alert only fires when the bar fully closes, so do not expect instant firing mid-candle.
Putting it to use
Once your webhook is reliable, the natural next step is doing something useful with every signal instead of just watching it happen. Chart Grader can receive these webhooks directly, log every entry and exit into a trade journal automatically, and grade each one with AI, so you can tell whether a rule-based strategy actually holds up over time instead of guessing.
Want your TradingView strategy journaled and AI-graded automatically? Chart Grader's automated agents connect directly to a webhook like the one in this guide.
Set up an automated strategy →