Overview: Create an API key in OKX with Read and Trade → bind AlgoWay IP → add the key to the AlgoWay Dashboard → create a TradingView alert that routes to your webhook.
103.241.67.174
API keys with IP allowlist are safer: OKX will accept requests only from AlgoWay.
my_key
.103.241.67.174
.Copy and store: API Key, Secret Key, and your Passphrase. OKX shows the Secret only once.
After saving, you’ll see your webhook in the list. Click the purple copy icon to copy the unique Webhook URL (UUID) — you’ll paste it into TradingView.
BTCUSDT.P
).{
"platform_name": "okx",
"ticker": "{{ticker}}",
"order_contracts": "{{strategy.order.contracts}}",
"order_action": "{{strategy.market_position}}",
"price": "{{close}}"
}
platform_name must be exactly: okx
. Otherwise the alert won’t be routed.
AlgoWay for OKX supports absolute prices and offsets in pips (pip = tick size of the instrument). If both are provided, absolute prices win.
Absolute SL/TP (prices):
{
"platform_name": "okx",
"ticker": "ETHUSDT.P",
"order_action": "buy",
"order_contracts": 1,
"sl_price": 1800,
"tp_price": 1850
}
Offsets in pips (from last price):
{
"platform_name": "okx",
"ticker": "BTCUSDT.P",
"order_action": "sell",
"order_contracts": 0.5,
"stop_loss": 50,
"take_profit": 100
}
Trailing Stop (always in pips):
{
"platform_name": "okx",
"ticker": "ARBUSDT.P",
"order_action": "buy",
"order_contracts": 10,
"trailing_pips": 50
}
flat
Send "order_action": "flat"
to close positions. In hedge mode, both long and short legs can be closed according to the size you send.
{
"platform_name": "okx",
"ticker": "BTCUSDT.P",
"order_action": "flat",
"order_contracts": 1
}
Executed orders and attached algos (TP / SL / trailing) appear in your OKX trading panel. Open positions are shown in the bottom panel.
AlgoWay is now connected to OKX. Your TradingView strategy alerts will place orders on OKX through your secured webhook.