Configure TradingView webhook alerts for OKX

Complete the webhook step for tradingview to okx automation with structured payloads and execution visibility in TradeAdapter.

Step 1

Use OKX symbols on TradingView

Confirm your chart symbol comes from OKX so routing for TradingView webhook automation is mapped correctly.

Step 2

Add strategy and create TradingView alert

Attach your Pine strategy, validate backtest results, then create an alert for buy/sell events.

Strategy setup
TradingView strategy setup
Alert setup
TradingView alert setup
Step 3

Set webhook URL and message payload

Use your TradeAdapter webhook URL and JSON payload to route alerts from TradingView to OKX EU with consistent execution.

Message
TradingView alert message JSON
Webhook URL
TradingView webhook URL notification
Step 4

Recreate alerts after strategy changes

Recreate TradingView alerts whenever strategy inputs change to keep real-time trade execution synchronized.

Region

Which OKX connection to use

The two OKX entities keep separate API keys: a key created on one does not exist on the other, and sending it to the wrong host fails with 50119 - API key doesn't exist. Pick the connection that matches where your account is registered.

  • OKX EU (this guide) - accounts registered on my.okx.com, the European entity - API: https://eea.okx.com - "exchange": "okx_eu"
  • OKX - accounts registered on www.okx.com - API: https://www.okx.com - "exchange": "okx" - see the OKX guide
JSON

TradingView alert message template

Credentials live on the broker you saved under My Brokers; market, ticker, order type, and quantity are configured once on that broker's Strategy — never in the TradingView alert. If your strategy uses Limit order type, or has Stop Loss / Take Profit enabled, also include "order_price": "{{close}}" in the alert. If your strategy has "Sync with TradingView position" enabled, also include market_position and prev_market_position from your strategy.

{
  "strategy_name": "okx_eu-momentum",
  "order_action": "{{strategy.order.action}}",
  "order_contracts": "{{strategy.order.contracts}}"
}