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
- 1TradingView cannot trade most exchanges itself; webhooks carry a JSON message to an executor that places the order.
- 2Strategies automate most cleanly; indicators need one alert per direction.
- 3Your plan’s alert limit sets your scale; build and manage alerts in bulk with the extension.
- 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
- 1A paid TradingView plan with enough alert capacity for your plan.
- 2A trade-only key on a live-ready venue, saved as testnet.
- 3A small batch built with the extension, checked in the plan roster.
- 4At least a week of paper fills, protective orders and closed-trade accounting you understand.
- 5Your webhook secret kept private, and you know where to rotate it.
- 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
- 1Creating alerts by hand next to a batch, so two alerts trade the same condition.
- 2Using intrabar alert frequency, so alerts fire on conditions that vanish before the bar closes.
- 3Publishing a script or screenshot that contains the webhook secret.
- 4Letting stale alerts fill the quota, so new batches are truncated.
- 5Testing on a venue that is not live-ready and wondering why nothing executes.
- 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
Connect BloFin to TensorTrader: API key, secret and passphrase
Create a trade-only BloFin demo key with its passphrase, save it in TensorTrader on paper first, and route TradingView alerts to BloFin perps.
Connect Interactive Brokers to TensorTrader with an OAuth kit
Generate the IBKR OAuth kit in TensorTrader, register it with Interactive Brokers, paste back your access token and paper (DU) account, and route TradingView alerts to US stocks and ETFs.
Connect Binance to TensorTrader: API key + secret, paper first
Create a trade-only Binance key, save it in TensorTrader on paper first, and see what works on Binance today, including TradingView alert execution.
Connect MEXC Global to TensorTrader: API key + secret, paper first
Create a trade-only MEXC Global key, save it in TensorTrader on paper first, and see what works on MEXC Global today.
Connect OKX to TensorTrader: API key + secret + passphrase, paper first
Create a trade-only OKX key, save it in TensorTrader on paper first, and see what works on OKX today, including TradingView alert execution.
Connect Bybit to TensorTrader: API key + secret, paper first
Create a trade-only Bybit key, save it in TensorTrader on paper first, and see what works on Bybit today, including TradingView alert execution.
Connect Bitget to TensorTrader: API key + secret + passphrase, paper first
Create a trade-only Bitget key, save it in TensorTrader on paper first, and see what works on Bitget today, including TradingView alert execution.
Connect dYdX (v4) to TensorTrader: Wallet-approved agent key, paper first
Approve a trade-only dYdX (v4) agent, save it in TensorTrader on paper first, and see what works on dYdX (v4) today, including TradingView alert execution.
Connect Deribit to TensorTrader: API key + secret, paper first
Create a trade-only Deribit key, save it in TensorTrader on paper first, and see what works on Deribit today, including TradingView alert execution.
Connect Gate.io to TensorTrader: API key + secret, paper first
Create a trade-only Gate.io key, save it in TensorTrader on paper first, and see what works on Gate.io today, including TradingView alert execution.
Connect HTX to TensorTrader: API key + secret, paper first
Create a trade-only HTX key, save it in TensorTrader on paper first, and see what works on HTX today.
Connect Kraken / Pro to TensorTrader: API key + secret + passphrase, paper first
Create a trade-only Kraken / Pro key, save it in TensorTrader on paper first, and see what works on Kraken / Pro today, including TradingView alert execution.
Connect KuCoin to TensorTrader: API key + secret + passphrase, paper first
Create a trade-only KuCoin key, save it in TensorTrader on paper first, and see what works on KuCoin today.
Connect Coinbase to TensorTrader: API key + secret, paper first
Create a trade-only Coinbase key, save it in TensorTrader on paper first, and see what works on Coinbase today.
Connect Bitfinex to TensorTrader: API key + secret, paper first
Create a trade-only Bitfinex key, save it in TensorTrader on paper first, and see what works on Bitfinex today.
Connect Crypto.com to TensorTrader: API key + secret, paper first
Create a trade-only Crypto.com key, save it in TensorTrader on paper first, and see what works on Crypto.com today.
Connect Phemex to TensorTrader: API key + secret, paper first
Create a trade-only Phemex key, save it in TensorTrader on paper first, and see what works on Phemex today, including TradingView alert execution.
Connect Vertex to TensorTrader: API key + secret, paper first
Create a trade-only Vertex key, save it in TensorTrader on paper first, and see what works on Vertex today.
Connect WOOFi Pro to TensorTrader: API key + secret, paper first
Create a trade-only WOOFi Pro key, save it in TensorTrader on paper first, and see what works on WOOFi Pro today.
Connect ApeX Pro to TensorTrader: API key + secret, paper first
Create a trade-only ApeX Pro key, save it in TensorTrader on paper first, and see what works on ApeX Pro today.
Connect BingX to TensorTrader: API key + secret, paper first
Create a trade-only BingX key, save it in TensorTrader on paper first, and see what works on BingX today, including TradingView alert execution.
Connect WhiteBIT to TensorTrader: API key + secret, paper first
Create a trade-only WhiteBIT key, save it in TensorTrader on paper first, and see what works on WhiteBIT today.
Connect Aster to TensorTrader: Agent wallet private key, paper first
Create a trade-only Aster key, save it in TensorTrader on paper first, and see what works on Aster today.
Connect Lighter to TensorTrader: Wallet-approved agent key, paper first
Approve a trade-only Lighter agent, save it in TensorTrader on paper first, and see what works on Lighter today, including TradingView alert execution.
Connect edgeX to TensorTrader: Account id + EIP-712 trading key, paper first
Create a trade-only edgeX key, save it in TensorTrader on paper first, and see what works on edgeX today.
Connect Gains Network to TensorTrader: Wallet-approved agent key, paper first
Approve a trade-only Gains Network agent, save it in TensorTrader on paper first, and see what works on Gains Network today.
Connect Synthetix Perps to TensorTrader: Wallet-approved agent key, paper first
Approve a trade-only Synthetix Perps agent, save it in TensorTrader on paper first, and see what works on Synthetix Perps today.
Connect VALR to TensorTrader: API key + secret, paper first
Create a trade-only VALR key, save it in TensorTrader on paper first, and see what works on VALR today.
Connect Alpaca to TensorTrader: APCA key id + secret, paper first
Create a trade-only Alpaca key, save it in TensorTrader on paper first, and see what works on Alpaca today, including TradingView alert execution.
Batch Build: strategies, indicators and multi-condition alerts in the TensorTrader extension
How the extension's Batch Create wizard turns one indicator or strategy into dozens of TradingView alerts: signal sources, AND-combined indicators, variable alignment, DCA across timeframes, leverage modes and duplicate-proof runs.
TradingView webhook JSON explained: every placeholder you can use
What a TradingView webhook message is, which {{placeholders}} TradingView fills in, which variables TensorTrader adds, and a working JSON template for automated orders.
TradingView alert limits by plan, and how to fit an automated strategy in them
How many concurrent technical alerts each TradingView plan allows, how an automated setup counts against the limit, and how to plan tokens × timeframes × directions to fit.
alertcondition() vs alert() vs strategy alerts in TradingView
The three ways a TradingView script can trigger alerts, how each behaves, which one to choose for automation, and how the TensorTrader extension detects them.
TradingView multi-condition alerts: combine up to 5 indicators with AND
How to require several indicators to agree before an automated entry, using TradingView multi-condition alerts built by the TensorTrader extension.
Pine strategy alerts: {{strategy.order.action}} and friends explained
How TradingView strategy alerts fire, what {{strategy.order.action}} and {{strategy.market_position}} contain, and how to automate a Pine strategy with correct sizing.
Filter, sort and bulk-delete TradingView alerts from one panel
How the TensorTrader extension’s Alerts tab filters TradingView alerts by token, exchange, timeframe, study and status, and enables, disables or deletes them in bulk.
TradingView study_error and alert rate limits: causes and fixes
Why TradingView alerts end up in study_error, how rate limits affect bulk alert creation, and how the TensorTrader extension detects both and stops safely.
Lorentzian Classification explained: the TradingView ML indicator, in plain English
How jdehorty’s Machine Learning: Lorentzian Classification works: nearest neighbours, Lorentzian distance, its five features, filters and kernel regression, plus the default settings.
Best TradingView indicators by market regime: results from a script tournament
Which TradingView scripts led TensorTrader’s tournament in each of six market regimes, how they were scored, and how to use regime-aware selection without fooling yourself.
TradingView alerts across multiple timeframes, with leverage, in every creation tool
How to run one strategy on several timeframes with per-leg margin and leverage in TensorTrader’s TradingView, TrendSpider, GoCharting and TT-Autotune alert builders.
Create orders from TradingView with the TensorTrader Chrome extension
From install to first fill: connect the extension, build alerts with Batch Create, enable trading, and follow the order from TradingView alert to exchange fill.
Keep reading
Hyperliquid trading bot: how to automate Hyperliquid perps safely
The complete guide to automating Hyperliquid: agent wallets, testnet, TradingView and GoCharting alerts, leverage and margin, fees and funding, portfolio mode, and the real results of our own testnet books.
Crypto trading automation, paper first: the complete guide
How to automate crypto trading without losing your shirt: key safety, testnets, market regimes, DCA, leverage, fees, backtests versus forward tests, choosing a platform, and our own honest results.
Not financial advice. Performance figures are TensorTrader testnet or backtest results with the method stated; past results do not predict future returns.