Skip to content

TradingView webhooks

Send TradingView alerts to Coinrule to trigger your strategy entries and exits.

Updated 2026-05-29·2 min read

TradingView can send HTTP alerts to Coinrule when your indicator or strategy conditions fire. Coinrule receives the alert, verifies the webhook secret, and dispatches a buy or sell signal to your strategy. Setup takes four steps: create the strategy, launch it, generate a secret, then configure the TradingView alert.

How do I set up the integration?

  1. Create a webhook strategy on Coinrule — describe it as "fire when I receive a TradingView signal" or similar. The strategy uses the WebhookSignal() indicator.
  2. Launch the strategy. The webhook secret is generated after launch.
  3. Open the TradingView panel on the strategy detail page. Click Generate to create a secret and copy the webhook URL.
  4. Set up the alert in TradingView: paste the webhook URL and set the alert message to the JSON payload shown in the panel.

The webhook secret is generated after launch, not before. You must launch the strategy first, then configure TradingView.

Webhook facts

PropertyValue
EndpointPOST /api/webhooks/tradingview/:strategyId
Rate limit30 signals per 60 seconds per strategy
Credit cost1 credit per accepted signal
Authsecret field in body (constant-time compare) or X-Coinrule-Signature HMAC header
Invalid secret response404 (anti-enumeration)

What payload modes are supported?

Strategy mode (recommended for Pine Script strategies):

{
  "id": "{{timenow}}-{{ticker}}",
  "secret": "<your-secret>",
  "symbol": "{{ticker}}",
  "side": "{{strategy.order.action}}",
  "price": "{{close}}"
}

Simple mode (for indicator alerts):

{
  "secret": "<your-secret>",
  "side": "buy"
}

The side field accepts: buy, sell, open_long, close_long, open_short, close_short, and equivalents.

How do I rotate the webhook secret?

On the strategy detail page → TradingView panel → Rotate. The old secret is immediately invalid. Update the alert message in TradingView with the new secret.

See Webhook payloads and secrets for full payload and security details.

Was this article helpful?

Trading involves risk. Past performance is not indicative of future results. Never trade with funds you cannot afford to lose. Coinrule does not provide financial advice.

Still stuck?

Contact support