Skip to content

Blog · TradingView · Guide · updated 2026-09-25

TradingView webhook automation: from alert to exchange order

Everything about automating TradingView: alert types, webhook JSON, plan limits, building hundreds of alerts with the Chrome extension, managing them, and executing on 30 exchanges and brokers, paper first.

Key takeaways

  1. 1TradingView cannot trade most exchanges itself; webhooks carry a JSON message to an executor that places the order.
  2. 2Strategies automate most cleanly; indicators need one alert per direction.
  3. 3Your plan’s alert limit sets your scale; build and manage alerts in bulk with the extension.
  4. 4The webhook secret is what keeps it safe: keep it private and rotate it if it leaks.

What TradingView automation is

TradingView is where most traders build and watch their strategies. It can watch a condition on thousands of charts at once and fire an alert when it happens, but it cannot place an order on your exchange. The bridge is the webhook: an HTTP request TradingView sends when an alert fires, carrying a message you define. A service that receives the webhook can turn it into a real order.

TradingView webhook automation is that whole chain: the script that produces the signal, the alert that watches for it, the message that describes the order, the service that validates and executes it, and the exchange where it fills. This guide walks through every link, using TensorTrader as the executor because it is what we build, but the principles apply to any bridge.

Chapter 1: the three kinds of alerts

A TradingView script can trigger alerts three ways. alertcondition() declares named conditions such as "Long entry" and "Short entry", and you create one alert per condition. alert() raises alerts from inside script logic with a message the script builds; one alert on "Any alert() function call" catches all of them. A Pine strategy fires a strategy alert on each simulated order fill, and passes {{strategy.order.action}} (buy or sell) and {{strategy.market_position}} (long, short or flat).

For automation, strategies are usually the cleanest: one alert per token covers entries, exits and reversals, because they all live in the script. Indicators with clear per-direction conditions work well too, with one alert per direction. The TensorTrader extension detects the mechanism automatically when you pick a script from your favorites.

Chapter 2: the webhook message

The alert message is plain text; if it is valid JSON, the receiver can read it as fields. TradingView fills placeholders in double braces at fire time: {{ticker}}, {{interval}}, {{close}}, plot values like {{plot_0}}, and strategy fields. TensorTrader adds its own {{tt.*}} variables, rendered per alert by the extension: the webhook secret, the action, the exchange and key, margin, leverage mode and cap, risk mode and identity keys.

The secret is what makes the whole thing safe. Anyone with your webhook URL and secret could send orders, so it never goes into public scripts or screenshots, and you rotate it the moment it leaks. TensorTrader also validates every field against an allow-list, so messages cannot smuggle unexpected keys.

{
  "secret": "{{tt.secret}}",
  "a": "{{tt.action}}",
  "sym": "{{ticker}}",
  "tf": "{{interval}}",
  "exchange": "{{tt.exchange}}",
  "exk": "{{tt.exchange_key_id}}"
}

Chapter 3: plan limits decide your scale

Webhooks need a paid TradingView plan, and each plan caps how many technical alerts can exist at once: Essential 20, Plus 100, Premium 400, Ultimate 1,000, in the tiers TensorTrader plans around. Automation eats alerts quickly: indicator strategies need two per token per timeframe, strategies one, and every DCA leg and exchange account multiplies the count. TensorTrader's own plans are keyed to your TradingView tier for that reason, and the extension truncates plans that would exceed your quota before creating anything.

Chapter 4: building alerts in bulk

Creating alerts by hand does not scale past a few dozen. The TensorTrader Chrome extension's Batch Create tab builds them in bulk: choose exchange keys, paste tokens (quote suffixes like USDT are stripped), pick a signal source from your TradingView favorites, align the script's conditions to long and short, set timeframes through DCA Across Timeframes, choose leverage and risk handling, and review the plan roster before creating.

Two features make it safe at scale. Idempotency: existing alerts are detected and skipped, every new alert is created exactly once with no blind retries, and a reconciliation sweep removes accidental duplicates by reading what actually exists on TradingView. Pre-flight: the first alert is checked for study_error before the rest are created, so a script that cannot run server-side does not burn your quota.

Chapter 5: confirmation with multi-condition alerts

Single indicators produce many false signals. TradingView's multi-condition alerts fire only when several conditions are true on the same bar; the extension combines up to five indicators with AND, each with its own input overrides, on a TradingView Plus plan or higher. Combine indicators that measure different things (trend, momentum, volatility) and keep it to two or three, or the alert may almost never fire.

Chapter 6: timeframes and leverage

Running one strategy on several timeframes spreads a position across different bets. DCA Across Timeframes does it in every TensorTrader alert builder: a base timeframe, a spectrum, extra pyramid legs alternating above and below the base, and margin weighted toward the base by 1 / (distance + 1). Leverage per alert is static, scaled with signal confidence, or scaled with market breadth, always clamped to the lower of your policy and the venue maximum.

Chapter 7: choosing scripts

The most popular automated script family on TradingView is Lorentzian Classification, jdehorty's nearest-neighbour classifier with Lorentzian distance, five oscillator features and a kernel-regression trend filter. TensorTrader's TT-Autotune tunes it per token, timeframe and regime. Beyond that, TensorTrader's tournament backtests published scripts and ranks them within each of six market regimes and each timeframe, using median per-symbol ROI, Sortino and worst drawdown. Treat the leaders as a shortlist for paper testing, not as a promise.

Chapter 8: managing alerts over time

Alert sets need maintenance. Changing settings means replacing alerts; TradingView sometimes stops alerts on its own; stale alerts waste quota. The extension's Alerts tab filters every alert by token, exchange, timeframe, study and status, selects all filtered or inverts the selection, and enables, disables or deletes in bulk, or clears everything with Delete all. Deleting an alert stops future signals but does not close positions it already opened.

When alerts end up in study_error, the script failed to calculate on TradingView's servers. Switching the mechanism to "Any alert() function call", lightening heavy inputs or trying another timeframe usually fixes it. When bulk creation hits TradingView's rate limit, the extension pauses, waits and reconciles instead of retrying blindly.

Chapter 9: execution on your exchange

When an alert fires, TensorTrader validates the message, maps the symbol to the venue's market, sizes the position, clamps leverage, and places the order on your own account with a trade-only key. After the fill it places protective orders, keeps reconciling with the exchange, and books every close from the venue's own fills. It executes on ten live-ready venues today (Binance, Hyperliquid, dYdX, BloFin, BingX, Gate.io, Phemex, Lighter, Interactive Brokers and Alpaca), all paper first, and stores and verifies keys on thirty.

Each venue has its own guide covering exactly what it needs: a key and secret, a passphrase, an agent wallet, or an OAuth kit, how to create it without withdrawal permission, and what works there today.

A checklist before your first live alert

  1. 1A paid TradingView plan with enough alert capacity for your plan.
  2. 2A trade-only key on a live-ready venue, saved as testnet.
  3. 3A small batch built with the extension, checked in the plan roster.
  4. 4At least a week of paper fills, protective orders and closed-trade accounting you understand.
  5. 5Your webhook secret kept private, and you know where to rotate it.
  6. 6Leverage at or below 3x, a daily loss cap or drawdown rule, and a way to pause everything in one step.

Choosing a venue for TradingView automation

The executor is only as good as the venue behind it. Pick a venue with a verified paper path so you can test for free, enough liquidity on the markets you trade to keep slippage small, and an authentication model you are comfortable with. Centralized exchanges like Binance, BloFin, Gate.io, Phemex and BingX use a trade-only API key and secret (plus a passphrase on BloFin). Decentralized venues like Hyperliquid, dYdX and Lighter keep custody with you and use agent keys. Interactive Brokers and Alpaca add US stocks and ETFs at 1x.

If you are not sure, start where the testnet is easiest for you, run the same small batch on two venues, and compare fills, fees and net results after a few weeks. Moving later is cheap: point step 1 of the Batch Create plan at a different key and re-run it.

What happens inside the executor

Each step fails closed. A message that fails authentication, a symbol that does not resolve, or an exchange confirmation that is ambiguous stops the order path rather than guessing. That is the property to look for in any bridge, because a guessed order is worse than a missed one.

authenticate
The secret in the message must match your account; anything else is dropped
validate
Fields are checked against an allow-list; unknown keys are ignored
resolve
The TradingView symbol is mapped to the venue’s market; unlisted symbols are rejected
size
Margin and leverage come from the alert and your policy
clamp
Leverage is reduced to the lower of your policy and the venue maximum
execute
The order is placed on your key; the real fill is read back
protect
Reduce-only stop-loss and take-profit orders are placed after the fill
reconcile
Positions are checked against the exchange; orphans are closed
book
Closes are booked from the venue’s fills with the reported fee

TradingView, TrendSpider and GoCharting side by side

All three feed the same executor with the same safety checks, and the same DCA, leverage and risk panels in the extension. Choose the charting platform you already use; the execution side does not change.

TradingView
Webhook alerts on paid plans; alert capacity by plan; Batch Create builds indicator, strategy and multi-condition alerts
TrendSpider
Webhook alerts through the same bridge; the extension sweeps stale alerts, renews expiring ones and respects the account cap
GoCharting
Webhook alerts with a JSON body, footprint and Lipi scripts; alerts expire and must be rebuilt before they do

Common mistakes

  1. 1Creating alerts by hand next to a batch, so two alerts trade the same condition.
  2. 2Using intrabar alert frequency, so alerts fire on conditions that vanish before the bar closes.
  3. 3Publishing a script or screenshot that contains the webhook secret.
  4. 4Letting stale alerts fill the quota, so new batches are truncated.
  5. 5Testing on a venue that is not live-ready and wondering why nothing executes.
  6. 6Judging a strategy on its TradingView backtest instead of on paper fills after fees.

Key terms

webhook
The HTTP request TradingView sends when an alert fires
placeholder
A {{name}} in the message that TradingView or the extension fills in
alertcondition()
A named condition you pick when creating an alert
strategy alert
An alert that fires on each simulated fill of a Pine strategy
multi-condition alert
An alert that fires only when several conditions are true together
reconciliation sweep
Reading the real alert list after a batch to remove duplicates

Frequently asked questions

Can TradingView place orders on my exchange by itself?
Only on a few brokers integrated into TradingView’s trading panel. For most crypto exchanges and DEXs you need a webhook bridge.
Is TradingView webhook automation free?
Webhooks need a paid TradingView plan. TensorTrader has a Free plan and 30- or 90-day beta trials.
How fast are webhook orders?
Alerts fire on bar close on TradingView’s servers and reach the executor in seconds; strategies that need sub-second timing are not a fit for webhooks.
Can I automate someone else’s script?
Yes, if it is in your favorites and exposes alerts. Respect the author’s terms; open-source scripts are easiest to audit.
What happens if two alerts fire at once?
Each is validated and executed on its own; the executor keeps one position record per leg and reconciles with the exchange.
Can I use TrendSpider or GoCharting instead of TradingView?
Yes. Both send webhooks to the same bridge with the same checks; the extension builds alerts for all three.
How do I stop everything quickly?
Turn off the provider’s execute switch or pause trading for your account; open positions keep their exchange-side protective orders.
Do I need a VPS?
No. TradingView runs alerts on its servers and TensorTrader executes on its own infrastructure.

Every TradingView guide

Keep reading

Not financial advice. Performance figures are TensorTrader testnet or backtest results with the method stated; past results do not predict future returns.

All guides · Start on paper · Pricing