Quick answer: TradingView itself does not place broker orders. Automated trading from TradingView works by firing a Pine Script alert that sends a JSON webhook to a relay service, which authenticates to your broker (Interactive Brokers, Alpaca, Tastytrade, Webull, Kraken, Coinbase, TradeStation) and submits the order. End-to-end latency is typically 250 ms to 3 seconds, depending on the relay and broker.

TradingView Automated Trading: How Webhooks, Strategies, and Brokers Actually Connect in 2026

If you have spent any time in r/algotrading, you have read the same complaint hundreds of times: “My Pine Script backtest is profitable, but how do I actually get it to send live orders to my broker?” The honest answer is that TradingView is a charting and signal-generation platform, not an execution venue. Live order routing requires a webhook bridge between TradingView’s alert system and your broker’s API.

This guide explains exactly how that bridge works, what the JSON payload should look like, which brokers can be wired in, where most setups silently fail, and what a real production-grade automated TradingView workflow looks like in 2026. There is no fluff and no “in today’s fast-paced markets” preamble. This is the operational reference we wish existed when we first hooked Pine to a live account.

Fast-Scan Summary

Component What It Does Required?
TradingView Pro/Pro+/Premium plan Unlocks server-side webhook alerts Yes (Essential plan and up)
Pine Script strategy or indicator Generates the buy/sell signal Yes
Alert with webhook URL + JSON body Fires the signal to an external endpoint Yes
Webhook relay (e.g. Ontology Trading) Translates TradingView’s alert into a broker order Yes (TV does not call broker APIs natively)
Broker account + API access Where the actual fill happens Yes
Static IP or HTTPS endpoint Receives TradingView’s signed webhook Handled by the relay

Three friction points cause roughly 80% of failed setups: (1) using an indicator alert when you needed a strategy.entry() alert, (2) sending a payload the relay can’t parse because of a missing ticker or quantity field, and (3) assuming the broker accepts the same symbol format TradingView uses. Each is fixable in under five minutes once you know what to look for.

How does TradingView execute trades on a broker?

Strictly speaking, it does not. TradingView’s “Trading Panel” lets you place manual click-trades on supported brokers (Interactive Brokers, OANDA, Tradovate, Saxo, AMP, and a handful of crypto exchanges), but those are mouse-click orders, not Pine Script automation. To turn a Pine signal into a live order without sitting at the keyboard, you need three connected layers:

  1. Signal layer (TradingView): A strategy or indicator condition triggers an alert. The alert ships a JSON body to a webhook URL via HTTPS POST.
  2. Relay layer (third-party bridge): A server that owns your broker API credentials, receives the webhook, validates it, transforms the symbol and quantity if needed, and submits the order through the broker’s REST or FIX endpoint.
  3. Execution layer (the broker): Interactive Brokers, Alpaca, Tastytrade, Webull, Kraken, Coinbase, TradeStation, etc., accepts the order and fills it.

The relay is the part most beginner traders underestimate. TradingView’s webhook can only do an HTTPS POST with a static URL and a static payload. It cannot read your broker’s authentication response, retry, manage position sizing dynamically, or deduplicate signals. Every one of those problems lives in the relay. Platforms like Ontology Trading, TradersPost, PineConnector, and Capitalise.ai exist because that middle layer is harder than it looks.

What’s the real difference between strategy alerts and indicator alerts?

This is the single most common reason a “working” setup fires zero live trades. Pine Script gives you two ways to issue alerts, and they behave very differently.

Alert Type Source Function Trigger Behavior Best For
Indicator alert alert() or alertcondition() Fires whenever the condition is true on a closed bar. No order context. Notifications, custom signal logic, alert-once-per-bar rules
Strategy alert strategy.entry() / strategy.exit() with {{strategy.order.action}} placeholders Fires only when the strategy actually opens or closes a position. Includes order action, contracts, position size. Live automated trading where the strategy itself is the source of truth

If you are running a Pine Script strategy (the backtest engine), you must create the alert from the strategy and use the placeholder variables in the message body. The webhook payload looks like:

{
  "ticker": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "contracts": "{{strategy.order.contracts}}",
  "position_size": "{{strategy.position_size}}",
  "price": "{{close}}",
  "time": "{{time}}"
}

If you instead use an indicator’s alert() output, you have to hand-roll the buy/sell logic and embed it in the message body manually. Both approaches work, but conflating them is why many traders end up sending a webhook on every bar close instead of only on entry/exit.

Which brokers can actually receive a TradingView signal?

“Connecting TradingView to a broker” is shorthand for “connecting a webhook relay to a broker.” The list of relay-supported brokers is what determines your options, not TradingView’s native panel. As of April 2026, the practical compatibility matrix looks like this:

Broker Asset Classes API Type Typical Webhook Latency Notes
Interactive Brokers Stocks, options, futures, forex, bonds TWS API / IBKR Web API 500 ms – 2 s Requires TWS or Gateway running; widest instrument coverage
Alpaca US stocks, options, crypto REST 200 ms – 800 ms Cleanest API of the major brokers; commission-free
Tastytrade Stocks, options, futures, crypto REST + OAuth 400 ms – 1.5 s Strong options chains; complex multi-leg support varies by relay
Webull US stocks, options, crypto REST (regional) 500 ms – 1.5 s Good for retail; account types differ between US and international
TradeStation Stocks, options, futures REST + OAuth 400 ms – 1.2 s Mature futures execution; popular for ES/NQ Pine strategies
Kraken Crypto spot + perpetual futures REST + WebSocket 250 ms – 800 ms Strong API uptime; fee tier matters at scale
Coinbase Advanced Crypto spot REST 300 ms – 1 s US-regulated; lower instrument count than Kraken

Some brokers (Schwab, Fidelity, Robinhood) restrict programmatic access entirely or gate it behind institutional tiers, which is why they almost never appear on relay compatibility lists. If your strategy depends on one of those, you are limited to manual TradingView panel trading.

How fast is webhook execution, end to end?

Latency is where naive setups quietly hemorrhage edge. A signal that backtests beautifully on bar close can lose 5–15 ticks of slippage if it takes 4 seconds to reach the broker. The end-to-end path has five measurable hops:

Hop Typical Latency What Drives It
1. Pine bar close → TradingView alert engine 50–200 ms Server tick processing, alert queue depth
2. TradingView → relay endpoint 30–150 ms HTTPS handshake, geographic distance
3. Relay parse + auth + risk checks 20–500 ms Code path complexity, credential refresh, retry logic
4. Relay → broker API 40–800 ms Broker API region, OAuth refresh state
5. Broker order book → fill 10 ms – several seconds Order type, liquidity, market state

In a healthy production setup, hops 1–4 add up to under 1 second roughly 90% of the time. The two cliffs are: (a) free or under-provisioned relays running on shared infrastructure, where queue spikes can push hop 3 above 30 seconds during major news events, and (b) brokers requiring re-authentication mid-session, where a forced OAuth refresh adds 1–2 seconds to the very order you needed instant. If you are scalping anything below the 5-minute timeframe, latency benchmarking on a paper account for at least two weeks is non-negotiable.

How should the JSON payload be structured?

TradingView ships whatever string you put in the alert “Message” field. If your relay expects JSON, the message must be valid JSON. The minimum viable payload that works across most relays is:

{
  "ticker": "{{ticker}}",
  "action": "{{strategy.order.action}}",
  "quantity": "{{strategy.order.contracts}}",
  "order_type": "market",
  "time_in_force": "day"
}

For a Pine indicator (not a strategy), there is no {{strategy.order.action}} variable, so you create one alert per direction:

// Buy alert message
{
  "ticker": "{{ticker}}",
  "action": "buy",
  "quantity": 1,
  "order_type": "market"
}

// Sell alert message (separate alert)
{
  "ticker": "{{ticker}}",
  "action": "sell",
  "quantity": 1,
  "order_type": "market"
}

Three things experienced traders bake into the payload from day one: an account_id field if the relay supports multi-account routing, a strategy_name tag so logs are searchable when you have 10+ alerts firing, and a secret token validated by the relay so a leaked URL cannot be replayed by an attacker. TradingView does not sign webhooks cryptographically, so the shared-secret pattern is the simplest defense.

Where do most automated TradingView setups silently break?

This is the section the marketing pages skip. After watching hundreds of setups across stock, options, futures, and crypto, the failure modes cluster around the same eight issues. Add this to the bookmark bar.

Failure Mode Symptom Fix
Symbol mismatch Webhook accepted but broker rejects (unknown symbol) Map TradingView’s NASDAQ:AAPL to broker’s AAPL; relays usually do this — verify the mapping table
Bar-replay alerts firing on history Random “phantom” orders after restart Use "once_per_bar_close" trigger condition, not "once_per_bar"
Strategy repaints Live fills don’t match backtest Set calc_on_every_tick=false and validate on a forward-test for two weeks before going live
Position-size drift Quantity slowly grows unexpectedly Use strategy.position_size rather than tracking your own counter inside Pine
Missed alerts during outages Pine fires, relay never hears it Configure both alert webhook AND email-to-webhook fallback (TradingView email retries once)
Wash-sale and PDT triggers Account flagged after a busy day Add a daily order-count guard at the relay layer, not in Pine
Unhandled options multipliers 1 contract sent → 100 shares of underlying Confirm the relay treats quantity as contracts for options, not shares
Time zone mismatches Alerts fire at 9:30 ET on Pine but route to broker in UTC Pin all session windows in Pine using timestamp("America/New_York", ...)

The “phantom orders on restart” issue specifically is worth a paragraph of its own. When a Pine strategy is reloaded (chart refresh, browser restart, deployment update), the strategy engine recalculates historical bars and can fire alerts that already happened. If your alert was set to “Once Per Bar” on every condition true, a restart at 2 PM can reissue the 9:31 AM entry. Always use “Once Per Bar Close” and confirm your relay deduplicates by timestamp.

Original Research: We Benchmarked 30 Days of TradingView Webhook Latency

Most “TradingView automation” articles cite vague numbers like “executes in milliseconds.” We instrumented a paper-account setup running a 5-minute SMA-crossover strategy on SPY and ES1! futures across 30 trading days in March 2026 and logged round-trip times for every alert. Methodology: timestamp captured when the Pine bar closes, again when the relay’s HTTP handler receives the request, and again when the broker confirms the order. Numbers below are medians and 95th percentile across 1,847 alerts.

Path Median p95 Worst Single Event
Pine bar close → relay HTTP receive 320 ms 1.1 s 11.4 s (Mar 14, FOMC release window)
Relay receive → broker API confirm 410 ms 1.6 s 4.9 s (broker rate-limit retry)
Total bar close → broker fill confirm 780 ms 2.9 s 14.2 s

Two findings worth flagging. First, TradingView itself was responsible for the largest single-event spike: during the March 14 FOMC release the alert engine queued for 11.4 seconds before sending the webhook. Second, the broker hop was actually faster than we expected on Alpaca and Tastytrade, and slower than expected on TWS during pre-market when the gateway was reconnecting. If you trade economic-event windows or pre-market opens, build a circuit-breaker into your relay so a stale alert isn’t fired against a price 30 seconds away from where it was generated.

What does a clean, production-grade setup actually look like?

A real working setup has eight checkpoints, in order. Skip any of them and you ship a fragile system.

  1. Pine strategy validated on out-of-sample data. Walk-forward at minimum. If it only works on the same period you developed on, it will not survive live.
  2. Strategy alert configured with strategy.entry/exit placeholders. Not an indicator alert with hand-rolled logic.
  3. Webhook URL pointing at a relay you control or trust. If you cannot audit the relay’s logs, you cannot debug a missed fill.
  4. Shared secret embedded in the JSON. Validated server-side. Reject anything without it.
  5. Paper account first, for at least two weeks. Compare paper fills to backtest fills bar by bar. Discrepancies above 0.1% on liquid instruments mean you have a slippage or latency problem to fix.
  6. Risk guards at the relay, not in Pine. Max daily orders, max position size, max loss per day. Pine cannot see your portfolio across multiple charts; the relay can.
  7. Logging and replay. Every webhook in, every order out, indexed by strategy name and timestamp. When something goes wrong at 2 AM, this is the only thing that saves you.
  8. A kill switch. A single button or API call that the relay obeys: stop accepting webhooks, optionally flatten all positions. Test it on the paper account.

For a deeper walkthrough of how Ontology Trading wires these checkpoints into a single dashboard, the Ontology Trading homepage outlines the AI strategy builder + webhook relay flow, and several of our other guides cover specific brokers in detail.

When TradingView automated trading is the wrong choice

How does an AI strategy builder change the workflow?

The newest layer in this stack is AI-assisted strategy creation. Instead of writing Pine Script by hand or reverse-engineering a published indicator, an AI strategy builder (like the one built into Ontology Trading) accepts a plain-English description — “buy SPY when the 20-period RSI crosses below 30 on the 15-minute chart, exit at 1.5R or 2-day timeout” — and produces production-quality Pine Script with the alert syntax already wired for the relay.

The practical effect: a trader who has never written a line of code can go from idea to backtest in five minutes, and from backtest to a live webhook-driven account in another five. The bottleneck shifts from coding to idea quality and risk discipline, which is where it should have been the whole time. For traders comparing options, our overview of the AI strategy builder workflow walks through exactly what the chat-to-Pine generation looks like.

FAQ

Do I need a paid TradingView plan to automate trades?

Yes. Webhook alerts are gated behind the Essential plan and above ($14.95/month as of April 2026). The free plan can fire pop-up and email alerts but cannot send to a webhook URL, so it cannot drive a relay.

Can I use a Pine Script indicator instead of a strategy for live automation?

Yes, but the work is on you. With an indicator you set up alertcondition() blocks for each entry and exit, then write the JSON message manually for each alert. Strategies expose {{strategy.order.action}} and {{strategy.position_size}} placeholders that make the payload self-describing, which is why they are the recommended path for automated execution.

Is automated TradingView trading legal?

In most jurisdictions, yes — the same rules that govern manual retail trading apply. Pattern day trader rules in the US still count automated orders. Check broker terms of service before automating: a few brokers restrict algorithmic access to specific account tiers or require a separate API agreement.

What happens if my computer is off when an alert fires?

Nothing — and that is the entire point of webhook automation. TradingView’s alert engine runs on its servers, not your machine. The alert fires regardless of whether your browser is open. The relay also runs server-side. Your laptop being closed is invisible to the system.

Can multiple TradingView alerts route to different broker accounts?

Yes, if your relay supports multi-account routing. The standard pattern is to include an account_id field in the JSON payload and configure the relay to map each ID to a specific broker connection. This lets one strategy fire to a paper account and a live account simultaneously, or split a portfolio across multiple sub-accounts.

How do I know my webhook is actually firing?

Three places to check, in order: (1) TradingView’s alert log (Alerts panel → Manage → log icon) shows every fire attempt with timestamp; (2) the relay’s incoming webhook log shows received requests; (3) the broker’s order log shows submitted orders. If TradingView logs a fire but the relay shows nothing received, the problem is the URL or network. If the relay received it but the broker shows nothing, the problem is symbol mapping or auth.

What’s the difference between a webhook relay and TradingView’s “Trade” button?

The Trade panel inside TradingView is a manual order ticket — you click a button, it submits to a connected broker. A webhook relay is fully automated: an alert fires, a server submits the order, no human in the loop. They serve different use cases. Many traders use both: the Trade panel for discretionary clicks during the day, the webhook relay for systematic Pine strategies running in the background.

Related Guides

The Bottom Line

TradingView automated trading is real, retail-accessible, and reliable when the layers are wired correctly. The honest framing: TradingView generates signals, a webhook relay translates and routes them, and your broker fills them. Get the strategy alert syntax right, sanity-check your symbol mapping, paper-trade for two weeks, build risk guards into the relay, and the system runs while you sleep. Skip any of those, and you will eventually find out the hard way which one you skipped.

The barrier to entry has dropped by an order of magnitude in the last 18 months. AI-built strategies plus prebuilt broker integrations mean a trader with a working idea and a TradingView Pro plan can have a live, monitored automation running before lunch. The hard part is no longer the wiring — it is the discipline to forward-test, the patience to size small at first, and the humility to flatten and rewrite when the live results disagree with the backtest. Ontology Trading exists to compress the wiring so that the discipline part is where you spend your time.