Skip to main content

Documentation Index

Fetch the complete documentation index at: https://uncoded.ch/docs/llms.txt

Use this file to discover all available pages before exploring further.

TradingView webhook integration lets you drive your unCoded bot from TradingView’s Pine-Script alerts. Author your strategy in TradingView’s chart-based environment, set up alerts, and have them fire webhooks to your SignalsBot. Useful when you have an existing TradingView setup or prefer Pine Script’s expressiveness over the SignalEditor’s canvas.

When to pick this recipe

You have an existing TradingView strategy

You’ve authored Pine Script strategies in TradingView, validated them with TradingView’s tools, and want to automate the execution.

You prefer Pine Script over the SignalEditor canvas

Pine Script offers expressiveness the SignalEditor’s drag-and-drop canvas doesn’t. If you’re comfortable with code-style strategy authoring, this is the path.

You want to leverage external charting

TradingView’s chart-based experience is unmatched. Strategy ideas that you’ve worked out visually on charts can drive the bot via webhooks.

You're integrating signals from a third party

Some signal providers publish TradingView alerts. The recipe shows you how to wire those into your bot.

When NOT to pick this recipe

  • You don’t have a TradingView paid plan — webhook alerts are a paid TradingView feature (Pro and above).
  • First-week operators — get comfortable with modes and SignalEditor recipes first.
  • You don’t trust the third-party signal source — webhook recipients can change configuration. Trust assessment first.
  • You want everything to live on your VPS — TradingView webhooks involve a third party (TradingView’s servers). Latency and reliability are out of your control.

Prerequisites

1

TradingView Pro+ subscription

Webhooks are a paid feature. Verify your plan supports webhook alerts.
2

SignalsBot deployed and reachable

Behind a TLS reverse proxy with a real DNS name (e.g., signals.yourdomain.com).
3

Webhook secret set

TRADINGVIEW_WEBHOOK_SECRET environment variable on the SignalsBot. Generate with openssl rand -hex 32.
4

Mode running on the target pair

The recipe gates buying on the mode. The mode itself must be configured first.

Setup steps

1

Author your TradingView strategy

On TradingView, open your symbol’s chart. Apply your Pine Script strategy or use a built-in indicator.Example: a simple RSI alert that fires when RSI(14) crosses below 30.
2

Create an alert

Click the alarm clock icon → “Create Alert.”
3

Configure the alert condition

Set the condition matching your strategy logic. For RSI < 30 example: “RSI” → “Crossing Down” → 30.
4

Set the alert to fire on bar close

Critical: select “Once Per Bar Close” to avoid intra-bar firing.
5

Set the webhook URL

In the alert dialog, scroll to “Notifications” → “Webhook URL.” Paste your SignalsBot endpoint:
https://signals.yourdomain.com/webhook
6

Set the alert message body

The message body becomes the webhook payload. Set it to JSON:
{
  "secret": "<your-shared-secret>",
  "pair": "BTCUSDT",
  "mode": 4,
  "canBuy": true
}
Replace <your-shared-secret> with the value you generated. TradingView allows variable substitution ({{ticker}}, {{close}}, etc.) — you can use these to make the message dynamic.
7

Save the alert

The alert is now active and will fire when the condition holds.
8

Build the mirror exit alert

Create a second alert with opposite condition (RSI > 70 or whatever your exit signal is) and webhook payload writing canBuy: false. This brackets the buying windows.
9

Test with a manual trigger

Use TradingView’s “Once” alert option to fire a single test alert. Verify it lands at the SignalsBot:
  • SignalsBot’s audit log shows the accepted webhook.
  • Dashboard’s mode panel shows canBuy flipped accordingly.
10

Forward-test on small capital

Allocate $1,500–$3,000 to the mode. Run for 2–4 weeks observing the alerts firing and the bot’s response. Compare against TradingView’s signal log to confirm no missed alerts.
11

Promote to full capital if validated

Once forward-test confirms reliability, scale to full mode capital.

TradingView webhook reliability

TradingView webhook delivery typically arrives within 1–10 seconds of the alert firing. Acceptable for most timeframe-driven strategies.Don’t use this for high-frequency scalping where seconds matter. The latency floor is too high.
TradingView retries failed webhook deliveries. Retries are typically idempotent (same message), so duplicate handling at the SignalsBot is graceful.However: TradingView is not a hard delivery guarantee. Outages or quirks can cause missed alerts. Don’t depend on TradingView for safety-critical signals.
TradingView’s webhook source IPs are public (TradingView documents them). For tighter security, you can IP-allowlist these IPs at your reverse proxy.Trade-off: TradingView occasionally adds new source IPs, requiring you to update the allowlist.
TradingView’s alert message can include Pine variables: {{ticker}}, {{close}}, {{strategy.position_size}}, etc. Use these to include dynamic data in your webhook payload.Example: "price": {{close}} includes the closing price at alert time.

Common mistakes

Default alert mode is “Once Per Bar” — fires intra-bar on first condition met. Floods the SignalsBot if condition holds for the full bar.Fix: explicitly select “Once Per Bar Close.”
The shared secret is included in TradingView’s alert message. If you save your TradingView strategy publicly (TradingView’s strategy share feature), the secret leaks.Fix: keep your TradingView strategies private, or use placeholder secrets in shared versions.
Like other recipes — without the OFF mirror, flags stay flipped forever once entered.Fix: pair every entry alert with an exit alert.
If you’re using a third-party Pine Script signal, they have webhook authority over your bot. Audit their signals weekly via the SignalsBot’s audit log.Fix: don’t subscribe to opaque “AI signal” providers. Use TradingView strategies you understand.
TradingView webhooks travel the public internet. Without TLS, your shared secret is in the clear.Fix: TLS reverse proxy is mandatory.

What’s next

SignalsBot

The receiver TradingView posts to.

API Key Security

Webhook secret hygiene principles.

RSI Mean-Reversion

Native SignalEditor alternative — same logic without TradingView.

Architecture

How webhooks fit into the overall system.
Last modified on May 3, 2026