Use OKX symbols on TradingView
Confirm your chart symbol comes from OKX so routing for TradingView webhook automation is mapped correctly.
Add strategy and create TradingView alert
Attach your Pine strategy, validate backtest results, then create an alert for buy/sell events.
Set webhook URL and message payload
Use your TradeAdapter webhook URL and JSON payload to route alerts from TradingView to OKX with consistent execution.
Recreate alerts after strategy changes
Recreate TradingView alerts whenever strategy inputs change to keep real-time trade execution synchronized.
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"
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-momentum",
"order_action": "{{strategy.order.action}}",
"order_contracts": "{{strategy.order.contracts}}"
}