TradingView
Send signals from TradingView
Trading Hub accepts inbound webhooks from TradingView Pine Script alerts. Any strategy or indicator that fires an alert can route a signal directly into your account.
01Find your webhook URL and token
Go to Profile → Exchanges and scroll to the TradingView Webhook section. You'll see your unique webhook URL and token. Copy both — you'll need them in TradingView.
The token in the payload authenticates the request — treat it like a password. It is never sent in headers or query strings.
02Regenerating your token
If you suspect your token has been compromised, click Regenerate in the Exchanges settings. The old token is immediately invalidated — any existing TradingView alerts using it will start returning 401 errors until you update them with the new token.
After regenerating, update the token field in every TradingView alert that sends to this endpoint.
03Payload format
Send a POST request with a JSON body to your webhook URL. The Content-Type header must be application/json.
tokenstringYesYour personal webhook token from Profile → Exchanges.symbolstringYesTrading pair. Accepts BTCUSDT or BTC/USDT format — normalised internally.action"BUY" | "SELL"YesSignal direction. BUY maps to LONG; SELL maps to SHORT.pricenumberNoEntry price. If omitted, the signal is saved without a specific entry.slnumberNoStop-loss price.tpnumberNoTake-profit price.Example payload
{
"token": "your-webhook-token",
"symbol": "BTCUSDT",
"action": "BUY",
"price": 67100,
"sl": 65800,
"tp": 69500
}04TradingView Pine Script example
Add an alert to your Pine Script strategy using alert(). Paste the JSON payload as the alert message and set the webhook URL in TradingView's alert settings.
//@version=6
strategy("Trading Hub Signal", overlay=true)
longCondition = ta.crossover(ta.sma(close, 9), ta.sma(close, 21))
shortCondition = ta.crossunder(ta.sma(close, 9), ta.sma(close, 21))
if longCondition
strategy.entry("Long", strategy.long)
msg = '{"token":"YOUR_TOKEN","symbol":"' + syminfo.ticker + '","action":"BUY","price":' + str.tostring(close) + '}'
alert(msg, alert.freq_once_per_bar_close)
if shortCondition
strategy.entry("Short", strategy.short)
msg = '{"token":"YOUR_TOKEN","symbol":"' + syminfo.ticker + '","action":"SELL","price":' + str.tostring(close) + '}'
alert(msg, alert.freq_once_per_bar_close)Replace YOUR_TOKEN with the token from Profile → Exchanges.
Webhook signals respect your current trading mode. In Paper Mode, the signal is logged and tracked but no real order is placed. Switch to Live Mode in your risk profile when you're ready to execute.
Connect TradingView in minutes
Sign up, grab your webhook URL from the Exchanges page, and wire up your first alert.
Create your account