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 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

OKX region mapping and exchange value

Use the exchange value that matches where your OKX account was registered.

  • OKX_US - US and AU users registered on app.okx.com - API: https://us.okx.com - "exchange": "okx_us"
  • OKX_EU - EU users registered on my.okx.com - API: https://eea.okx.com - "exchange": "okx_eu"
  • OKX - Global users registered on www.okx.com - API: https://openapi.okx.com - "exchange": "okx"
JSON

TradingView alert message template

{
  "okx_api_key": "PUT YOUR OKX APIKEY HERE",
  "okx_secret": "PUT YOUR OKX SECRET HERE",
  "okx_passphrase": "PUT YOUR OKX PASSPHRASE HERE",
  "real_order": "Yes / No",
  "order_market": "Spot / Futures / Swap",
  "order_type": "Market / Limit",
  "exchange": "okx",
  "ticker": "{{ticker}}",
  "time": "{{timenow}}",
  "order_contracts": "{{strategy.order.contracts}}",
  "order_action": "{{strategy.order.action}}",
  "order_price": "{{strategy.order.price}}"
}