Back to Blog
    Trading Education
    #tradingview
    #automation
    #webhooks

    How to Automate TradingView Indicators with Alerts and Webhooks

    NickTradesNickTrades
    September 9, 20263 min read
    Share:
    How to Automate TradingView Indicators with Alerts and Webhooks


    How to Automate TradingView Indicators with Alerts and Webhooks

    TradingView cannot place trades by itself. What it can do is send a message the instant an indicator condition is met — and that message can drive almost anything.

    The architecture

    ```text
    Indicator condition met

    TradingView alert fires

    Webhook POST to your endpoint

    Your service (or a broker bridge) acts
    ```

    Everything downstream of the alert is your responsibility. TradingView's job ends at delivering the message.

    Step 1: expose a condition

    Automation needs a specific, machine-readable trigger. Use an indicator that exposes named alert conditions, or write one in Pine Script with `alertcondition()` or `alert()`.

    Step 2: create the alert with a webhook

  1. Right-click the indicator → Add alert on ....

  2. Pick the condition.

  3. Set the trigger to Once Per Bar Close — mid-candle triggers on a wick will place trades you did not want.

  4. Open the Notifications tab and tick Webhook URL.

  5. Paste your endpoint URL (must be HTTPS).

  6. Put structured JSON in the message body.
  7. Webhooks require a paid TradingView plan.

    Step 3: write a message your service can parse

    ```text
    {
    "symbol": "{{ticker}}",
    "action": "buy",
    "price": "{{close}}",
    "time": "{{timenow}}",
    "secret": "your-shared-secret"
    }
    ```

    Useful placeholders include `{{ticker}}`, `{{close}}`, `{{open}}`, `{{high}}`, `{{low}}`, `{{volume}}`, `{{interval}}`, `{{timenow}}`, `{{strategy.order.action}}` and `{{plot("name")}}`.

    Step 4: secure the endpoint

    Webhook URLs are effectively public once created. Anyone who learns the URL can post to it.

  8. Include a shared secret in the payload and reject anything without it.

  9. Validate the symbol and action against an allowlist.

  10. Rate-limit the endpoint.

  11. Log every request you receive.

  12. Start with a paper-trading account. Always.
  13. What automation is genuinely good for

    Full auto-execution is the least reliable use. These are more robust:

  14. Notifications with context — routing signals to a Discord or Slack channel.

  15. Journalling — appending every signal to a spreadsheet or database automatically.

  16. Screening — collecting signals across dozens of symbols and ranking them.

  17. Semi-automation — the webhook stages an order that you confirm on your phone.
  18. Frequently Asked Questions

    Can TradingView place trades automatically?

    Not on its own. TradingView sends alerts and webhooks; an external service or broker integration has to receive that message and place the order.

    Do I need a paid plan for webhooks?

    Yes. Webhook notifications are only available on TradingView's paid tiers.

    Is Pine Script required to automate an indicator?

    Not always. If the indicator already exposes alert conditions, you can automate it without writing any code. Pine Script is only needed for custom conditions.

    How do I stop false triggers in automated alerts?

    Use Once Per Bar Close rather than Once Per Bar, and require a trend filter as part of the condition so signals against the higher-timeframe trend never fire.

    Before you automate

    Automating a strategy that does not work simply loses money faster. Confirm the setup manually for a few weeks first. SimpleAlgo's signals expose named alert conditions specifically so they can drive webhooks once you trust them, and every plan carries a 7-day money-back guarantee. See the indicator suite.

    NickTrades

    NickTrades

    Founder of SimpleAlgo and professional trader sharing insights on trading strategies, market analysis, and product updates.

    Related Articles