Skip to main content

TradingView Alerts to Live Trades: Wiring Webhooks to Your Crypto Bot

· 8 min read
VolatiCloud Team
VolatiCloud

You've built the perfect TradingView indicator. The alert fires exactly when you want to trade. Then you spend the next two minutes manually opening a position on your exchange — and the candle you timed perfectly has already closed. VolatiCloud's new webhook integration changes that: a TradingView alert can now directly force-enter or force-exit a pair on your live bot, with no intermediary step.

VolatiCloud bot management page showing multiple bots with their current status, strategy, and exchange configuration

What TradingView Webhooks Actually Do​

TradingView has had an alert webhook feature for years: when an alert triggers, TradingView POSTs a JSON payload to a URL you specify. Until now, wiring that into a trading bot required running your own HTTP server, managing security, and building Freqtrade API integration yourself.

VolatiCloud generates a unique webhook token for each bot. When a POST reaches the webhook URL with that token and the right payload, the platform calls Freqtrade's forceenter or forceexit RPC on the running bot — the same mechanism you'd use from the UI to manually force a position. You get the full execution stack (exchange connectivity, stoploss enforcement, position tracking) without writing a single line of glue code.

The supported actions:

ActionEffectRequired fields
enterForce-enter a new positionpair, side (long or short), optional stake_amount
exitForce-exit an open position on that pairpair

Setting Up the Webhook URL​

Step 1: Open Bot Detail​

Navigate to Bots in the left sidebar, then click any running bot. On the Overview tab, scroll down to the TradingView Webhook section.

VolatiCloud bot detail Overview tab showing the TradingView Webhook card with a Reveal URL button and a payload example

Step 2: Reveal the URL and Your Token​

Click Reveal URL. The card shows two things:

  • The webhook URL, which is the same for every bot:

    https://api.volaticloud.com/gateway/v1/webhooks/tradingview
  • An alert message with your bot's token already filled in. Copy it with Copy alert message.

The token is a credential. It isn't loaded on page load, it requires the view-secrets scope, and it stays hidden until you ask for it. It is a 32-byte random value, so nobody can guess it. If it's ever compromised, rotate it with the Regenerate button, which invalidates the old token immediately.

The token goes in the alert message, never in the URL. Web servers, proxies and CDNs record URLs in their access logs, and a token in a URL ends up in every one of those logs. The message body is not logged.

Step 3: Create the TradingView Alert​

In TradingView, open Alerts → Create Alert. Set your condition (price cross, indicator threshold, whatever fires your signal). In the Notifications tab:

  1. Enable Webhook URL
  2. Paste the VolatiCloud webhook URL
  3. Set the Message field to the JSON payload you want to send, including your token

A force-entry payload:

{ "token": "YOUR_WEBHOOK_TOKEN", "action": "enter", "pair": "BTC/USDT", "side": "long", "stake_amount": 50 }

A force-exit payload:

{ "token": "YOUR_WEBHOOK_TOKEN", "action": "exit", "pair": "BTC/USDT" }
Set up before this change?

Earlier webhook URLs ended in the token (.../webhooks/tradingview/<token>). Those URLs still work for now, but that form will be retired. Change the alert's Webhook URL to the address above and add "token" to its message.

That's it. Click Create and TradingView will fire the webhook every time the alert triggers.

Payload Reference​

{
"token": "…", // Your bot's webhook token — required
"action": "enter", // "enter" or "exit"
"pair": "BTC/USDT", // Must match a pair the exchange supports
"side": "long", // "long" or "short" — required for "enter"
"stake_amount": 50 // Optional: overrides the bot's configured stake per trade
}

If stake_amount is omitted on an entry, the bot uses its configured stake amount. For exits you only need token, action and pair — the bot finds the open trade on that pair and closes it.

Using TradingView variables in the message

TradingView alert messages support placeholders like {{ticker}} and {{close}}. You can build dynamic payloads using these, but make sure the ticker format matches what your exchange expects. If your exchange wants BTC/USDT but {{ticker}} returns BTCUSDT, add a pair field explicitly rather than relying on the variable.

Pine Script Example​

Here's a complete TradingView alert setup using a simple RSI signal. The Pine Script outputs an enter signal when RSI drops below 30, and an exit signal when it crosses above 70:

//@version=5
strategy("RSI Webhook Demo", overlay=false)

rsiLength = input.int(14, "RSI Length")
rsi = ta.rsi(close, rsiLength)

// Entry: RSI oversold
if ta.crossunder(rsi, 30)
alert('{"token":"YOUR_WEBHOOK_TOKEN","action":"enter","pair":"BTC/USDT","side":"long","stake_amount":50}',
alert.freq_once_per_bar)

// Exit: RSI overbought
if ta.crossover(rsi, 70)
alert('{"token":"YOUR_WEBHOOK_TOKEN","action":"exit","pair":"BTC/USDT"}',
alert.freq_once_per_bar)

plot(rsi, "RSI", color=color.purple)
hline(70, "Overbought", color=color.red)
hline(30, "Oversold", color=color.green)

Set up two TradingView alerts for this script — one for each alert() call — both pointing to the same VolatiCloud webhook URL. When RSI crosses the threshold, TradingView fires the appropriate webhook.

Security Model​

The webhook token is treated with the same discipline as an API key:

  • Per-bot token — each bot gets its own independent token; compromising one doesn't affect others
  • Kept out of URLs — the token travels in the alert message body, so it never appears in request, proxy or CDN access logs
  • Reveal-to-view — the token is never loaded in the background, only on explicit user action, and requires the view-secrets scope on that bot
  • Instant rotation — clicking Regenerate issues a new 32-byte token and immediately revokes the old one; any TradingView alert still sending the old token will start getting 401 Unauthorized
  • IP rate limiting — the webhook endpoint rate-limits by IP to resist brute-force probing of token space

The endpoint responds with minimal error detail on bad tokens (it returns 401 with no payload, not "token not found" vs "bot not found") to avoid leaking information about which bots exist.

Accepted HTTP status codes from the webhook endpoint:

StatusMeaning
200Action executed
400Bad payload (invalid JSON, unknown action, missing fields)
401Bad or rotated token
404No open position found on that pair (for exit)
409Bot is not running
502Bot unreachable (Freqtrade RPC failure)

If TradingView receives a non-2xx response, it marks the alert delivery as failed — visible in TradingView's alert history. Use this to confirm your alerts are reaching the bot correctly.

Practical Use Cases​

Cross-timeframe signal execution​

Run your VolatiCloud bot on a 1-hour chart but use a TradingView alert on a 4-hour chart to override entries. The 4-hour chart sees a signal, fires the webhook, and the 1-hour bot executes. No multi-timeframe strategy code required — just two TradingView alerts and one webhook URL.

External signal providers​

Many traders subscribe to TradingView-based signal services that publish public Pine indicators with alerts. With the webhook integration, you can subscribe to a published alert, plug in your VolatiCloud webhook URL, and let a community indicator drive your bot — without rewriting their Pine Script into a Freqtrade strategy.

Emergency override​

Sometimes you want to force-close a position regardless of what the bot's strategy says — a news event, a late-night price spike, whatever. Add a TradingView price alert with a "action": "exit" payload, and you can close any pair from your phone via the TradingView mobile app without touching the VolatiCloud console.

Force-entries bypass normal position-open logic

The webhook enter action calls Freqtrade's forceenter directly, bypassing the strategy's entry signal conditions. The bot's stoploss, trailing stop, and exit conditions still apply after entry — but the entry itself ignores whether the strategy would normally open a position at that moment. Use this deliberately: it's a manual override, not a signal confirmation.

Connecting TradingView to VolatiCloud's Broader Stack​

The webhook is one piece of VolatiCloud's bot orchestration stack. While TradingView handles signal generation on its end, VolatiCloud's side handles:

  • Exchange connectivity — your bot already has the exchange credentials and order routing wired; the webhook just calls the existing RPC
  • Position tracking — forced entries appear in the trades tab alongside strategy-driven trades
  • Alerting — VolatiCloud's own alert system will fire notifications on the forced entry/exit the same as any other trade event (see Crypto Trading Bot Alerts)
  • Monitoring — real-time position monitoring still applies to webhook-driven trades (see Real-Time Bot Monitoring)

You're not building a parallel execution stack — you're plugging TradingView into the same stack that runs your automated strategy.

Getting Started​

If you already have a running bot, go to Bots → [your bot] → Overview → TradingView Webhook and generate your URL. The setup takes about two minutes once you have a TradingView alert condition ready.

If you haven't set up a bot yet, start with creating a bot — connect an exchange, pick a strategy, choose a runner, and within a few minutes you'll have a live bot that can receive TradingView signals.

Head to console.volaticloud.com to get your webhook URL and start routing TradingView alerts into live trade execution.