TradingView Webhooks for automated, real-time trading, actions based on signals.

TradingView Webhooks for automated, real-time trading, actions based on signals.
Photo by James Wheeler / Unsplash

TradingView webhooks are automated messages that send out a notification when a specific event occurs, such as a buy or sell signal from a custom indicator or strategy.

What’s a Webhook?

Think of a webhook as a "triggered text message" that gets sent to another app or service when something happens. In TradingView’s case, it’s triggered by your alerts.

Example, you’ve got a moving average crossover strategy on TradingView. When the fast moving average crosses above the slow one (a potential buy signal), you want TradingView to notify another service to act—like placing an order with a broker or logging the trade in a spreadsheet. That’s where webhooks come in.

How It Works:

  1. Set Up Your Alert
    • You create an alert on a chart. You might say, "Send me a notification every time Bitcoin’s price hits $90,000."
    • In the alert settings, there’s a checkbox for "Webhook URL"—this is where you paste the URL of the service you want to notify.
  2. Webhook URL
    • This URL is like an address. It tells TradingView where to send the message when your alert is triggered.
    • For example, if you’re using a service like Zapier, or your own custom API, they give you a unique webhook URL like https://mywebhookservice.com/trading-alert.
    • You can customize the message that gets sent. It’s usually in JSON format (basically text structured in a way that apps can easily understand).
    • TradingView lets you put in variables like {{close}} (the closing price) or {{ticker}} (the asset symbol), so your message can include real-time data.
  3. When the Alert Fires
    • When your condition is met (e.g., Bitcoin hits $40,000), TradingView sends your customized message to the webhook URL.