Beginner webinar (in Russian): wallets, exchanges, P2P and cashing out. Tentatively 30 January 2027 Details →

Signal bot: what it is and how to connect TradingView to an exchange

Updated: · 7 min read ·

A signal bot is a bot that places orders when it receives a signal: most often an alert from TradingView that arrives at the exchange as a webhook (an HTTP request with a short message). The exchange reads the message, opens or closes a position and you do not have to sit at the screen. Webhooks need a paid TradingView plan, and the bot only executes: a bad strategy keeps losing, just without emotion.

Contents
  1. What a signal bot is and what it is not
  2. How TradingView connects to an exchange
  3. Set up the OKX Signal Bot step by step
  4. What the alert message contains
  5. Which TradingView plan you need
  6. Risks of automated signal trading

I started wiring TradingView alerts to an exchange because I kept missing entries: the RSI crossed, I was away from the phone, and the move was over. A signal bot fixes exactly that and nothing more. It does not know whether the signal is any good. It receives text, checks it, and sends an order.

Signal bot scheme: TradingView alert sends a webhook to the exchange, which places an order
The path of one signal: alert, webhook, bot, order.

What a signal bot is and what it is not

The chain has four parts. A condition on a chart (an indicator cross, a price level, a Pine Script strategy fill) triggers a TradingView alert. The alert sends a message to a webhook URL. The exchange receives it, checks the secret token and the age of the message, and places an order in the pair you set up. That is the whole idea.

A signal bot is not a money printer and not a strategy. If your indicator is wrong half the time, the bot will be wrong half the time, faster and at 3 a.m. Treat it as a way to execute rules you have already tested by hand. Indicators such as RSI, MACD and moving averages are the usual sources of signals.

OKX

OKX has a built-in Signal Bot that accepts TradingView webhooks. If your country is supported and you have no account yet, sign up through this link: the referral code is filled in for you and bots unlock after verification.

New accounts via the link are enrolled in the OKX New User Bonus program automatically.

Sign up on OKX
Referral code: K2FMEIJ3

The code can only be entered during sign-up.

How TradingView connects to an exchange

The pieces of a TradingView-to-exchange connection
PieceWhere it livesWhat it does
AlertTradingView, on the chartFires when your condition or strategy order happens
MessageThe alert's Message fieldText (JSON) that says what to do: action, pair, size
Webhook URLAlert, Notifications tabThe address the message is sent to; the exchange gives it to you
Signal tokenInside the messageA secret that proves the message is yours
Signal botThe exchange, Trading botsValidates the message and places the order with your leverage and margin

Based on the OKX help article on the signal bot with TradingView. Other exchanges name the pieces differently.

Which exchanges have this built in

On OKX the signal bot is a ready-made product: you create a signal in the marketplace, copy the webhook URL and the message template, and paste them into TradingView. I verified this flow in OKX's own help. For Binance, Bybit, Bitget and Gate I did not find a comparable button "paste a TradingView webhook here" in their official help, so I do not claim it exists.

On those exchanges people usually connect TradingView through their own small server or a third-party service that holds an API key. That is a different risk level: you hand a trading key to someone else's code. If you do it, create the key with trading permission only, never withdrawal, and restrict it by IP where the exchange allows it.

Set up the OKX Signal Bot step by step

Interactive

TradingView to OKX in six steps

Tick through the steps in order. Menu names can shift a little between app versions, so follow the screen if it differs.

Two details cost people time. First, the signal bot trades perpetual swap contracts, so leverage and liquidation apply even at 1x thinking. Second, a contract on TradingView and a contract on OKX can have different sizes, so a quantity copied from a strategy may not mean what you expect. Check the pair's contract size before the first live signal.

What the alert message contains

The message is JSON. OKX generates the template, so do not type it from memory. In the strategy template the fields include action, instrument, signalToken, timestamp, maxLag, investmentType and amount. A simplified custom message looks like this: {"action":"ENTER_LONG","instrument":"BTC-USDT-SWAP","signalToken":"your-token","timestamp":"{{timenow}}","maxLag":"60","investmentType":"percentage_balance","amount":"10"}. This is an illustration, always copy the real template from the signal page.

Fields of the alert message (simplified)
FieldMeaningExample
actionWhat to doENTER_LONG, EXIT_LONG, ENTER_SHORT, EXIT_SHORT
instrumentContract to tradeBTC-USDT-SWAP
signalTokenYour secret from the signal pageset by OKX
timestampWhen TradingView sent it{{timenow}}
maxLagHow old a message may be before it is ignored, in seconds60
investmentTypeHow to read amount: base, percentage_balance, percentage_positionpercentage_balance
amountSize of the order10

For Pine Script strategies OKX advises setting investmentType to base and amount to the strategy's order contracts, and sizing in USDT or contracts rather than percent of equity, because backtests and live trading can differ.

  • ENTER_LONG / ENTER_SHORT open a position in that direction.
  • EXIT_LONG / EXIT_SHORT close it.
  • percentage_balance is a share of free balance, used for entries.
  • percentage_position is a share of the open position, used for exits.

Four actions and three ways to measure size are enough for most setups. Take profit and stop loss are set in the bot itself, not in the alert.

Which TradingView plan you need

Webhook notifications are not available on the free plan. You need a paid one, and the cheapest paid plan, Essential, already includes webhook alerts. Prices and limits change, so check the current figures on the TradingView pricing page. Our plans comparison and the Essential vs Plus vs Premium guide show what else each tier gives. The number of alerts per plan is also a limit: one signal strategy on many pairs eats alerts quickly.

Open TradingView

Risks of automated signal trading

  1. False signals. Indicators fire in noise. A backtest on a chart is not a promise of live results.
  2. Delay. The path alert, webhook, exchange takes seconds. In a fast market the fill price differs from the chart.
  3. Leverage. The bot trades derivatives. A chain of losing signals with high leverage ends in liquidation.
  4. Duplicate or missed alerts. A TradingView outage or an expired alert means a position is not opened or not closed.
  5. A leaked token. Anyone with your webhook URL and token can send orders to your bot. Keep them private.

Most losses with signal bots come from the strategy and the leverage, not from the technology. Start with small margin and low leverage, and watch the first weeks manually.

Checklist before launching a signal bot with TradingView webhook: test, low leverage, stop loss
Before the first live signal.

If you are not sure you need automation at all, start with something simpler: the spot grid bot works without signals, and the overview of all OKX bots is in the OKX bots guide. Execution tools for large orders are covered in TWAP and iceberg orders.

OKX

New accounts via the link are enrolled in the OKX New User Bonus program automatically.

Sign up on OKX
Referral code: K2FMEIJ3
Bybit

New accounts via the link: tasks worth up to 250 USDT; 25% off spot fees paid in MNT.

Sign up on Bybit
Referral code: J8NKMG
TradingView
Open TradingView

Charts, indicators and alerts

FAQ

What is a signal bot?
A bot that opens and closes positions on an exchange when it receives a signal. The signal is usually a TradingView alert sent as a webhook message. The bot does not decide anything: it validates the message and places the order you configured.
How do I connect TradingView to an exchange?
Create a signal on the exchange (on OKX: Trading bots, Marketplace, Signal bot, Add custom signal), copy the webhook URL and the message template, paste them into a TradingView alert, then create the bot with a pair, leverage and margin. Test with a very small amount first.
Do I need a paid TradingView plan for webhooks?
Yes. Webhook alerts are not on the free plan; the cheapest paid plan, Essential, includes them. Check current prices and limits on the TradingView pricing page.
Does Binance or Bybit have a TradingView signal bot?
I did not find a built-in webhook signal bot in their official help, so I do not recommend a specific route. People connect them through their own server or third-party services with an API key, which is riskier. OKX has the feature built in.
Is a TradingView webhook free?
The webhook itself costs nothing on the exchange side, but TradingView requires a paid plan to send it. Some GitHub scripts advertise free webhook alerts; they are workarounds with their own risks, and I would not give them an API key.
Can a signal bot lose all my money?
Yes. It trades derivatives with leverage, and a wrong strategy, a delay or a series of false signals can liquidate the margin you assigned. Use only money you can lose and set a stop loss in the bot.
Sign up on OKX