Direct API Setup — Overview
How to connect TradingView to any supported exchange (Binance, Bybit, Kraken, OKX, and more) using TradeAdapter’s direct API integration.
How it works #
TradeAdapter receives a webhook from TradingView and forwards it as a real order to your exchange. The alert message is a JSON object that contains your API credentials, order parameters, and TradingView placeholders that get filled automatically when the alert fires.
The workflow is the same for every exchange — only the API key creation and specific field names change. Each exchange has its own setup guide with exact instructions.
The 5 steps #
-
1 — Create API keys on your exchange
Log in to your exchange and generate an API Key + Secret in the API Management section. Enable trading permissions (Spot, Margin, Futures — as needed) and keep withdrawals disabled. Whitelist the TradeAdapter IP so only TradeAdapter can use your keys.
-
2 — Select the exchange symbol in TradingView
Open TradingView and search for the symbol using the exchange prefix (e.g.
BINANCE:BTCUSDT,BYBIT:ETHUSDT). Make sure you pick the correct market type — Spot or Perpetual/Swap. The{{ticker}}placeholder in your alert message will send this exact name to the exchange. -
3 — Add your indicator or strategy to the chart
Load your Pine Script indicator or strategy onto the chart. This is what generates the trading signals. Not sure which one you have? See Indicator vs Strategy.
-
4 — Create the TradingView alert
Press Alt + A to create an alert. The setup depends on whether you’re using an indicator or a strategy:
Select your strategy under Condition, choose “Order fills only”. TradingView fills the action, size, and price automatically via placeholders like {{strategy.order.action}}.
Select the specific condition (Buy, Sell, TP, SL…). You set order_action and order_contracts manually in each message. Repeat for every action.
Required for both
In the Notifications tab, enable Webhook URL and paste your personal webhook from your TradeAdapter profile. Then paste the JSON message in the Message field — use the Message Generator on each exchange’s setup page to build it.
-
5 — Execute & monitor
After the first alert fires, check your MyTrades page to see if the signal was received, executed, or rejected. Then verify the trade on your exchange. Start with
"real_order": "No"to test safely — switch to"Yes"and recreate the alert when ready to go live.
Important notes #
API security — Never share your Secret. Keep withdrawals disabled. Use IP whitelisting.
Recreate alerts after changes — If you modify Pine Script parameters, delete and recreate the alert.
Symbol must match — The TradingView symbol must correspond to a valid symbol on your exchange.
Test first — Use
"real_order": "No" and check MyTrades before going live.
Exchange setup guides #
Pick your exchange below to follow the step-by-step guide with API key instructions, message format, and message generator.