Skip to content
OKX logo

Alerts to orders · Checked Nov 2026

Automate TradingView alerts to OKX

Nyria trades OKX spot pairs quoted in USDT, USDC or EUR. You connect with an API key. Market orders, sized by each bot's budget per entry.

Crypto spot
My strategies, then Create strategy: a strategy name typed in, TradingView picked as its alert source, then Next to what it trades, where Stocks is picked

Setup steps

Point the TradingView alert's webhook at a Nyria strategy. Then connect your OKX account in Nyria with your own OKX API key. Each alert becomes a spot order in your own OKX account. Each bot sizes its orders from its budget per entry.

  1. 1Connect OKX. In OKX, open okx.com/account/my-api and create an API key with a passphrase. Turn on Read and Trade, leave Withdraw off, and link Nyria's IP address to the key. In Nyria, select Integrations, then the OKX card, paste the API key, secret key and passphrase, then select Connect OKX.
  2. 2Create a strategy. In Nyria, select Create strategy and pick TradingView as the alert source. Choose crypto spot as the asset type. Set what an entry and an exit do on each side.
  3. 3Create the alert in TradingView. Open the alert dialog from the Alert button on the top toolbar. Set the Condition to your strategy or indicator. Open Message, paste the message from the strategy's Integration tab and select Apply. Open Notifications, tick Webhook URL, paste the strategy's webhook URL and select Apply. Then select Create. TradingView sends webhooks on its paid plans only, with two-factor sign-in on.
  4. 4Check the format. Back in Nyria, select Check format, then Check and save. The strategy turns Active once Nyria reads every side correctly. The Logs tab shows the ticker, side and contract it read.
  5. 5Deploy a bot. On the strategy, select Deploy bot. Pick the OKX account on the Account step and set a Budget per entry. Live bots need a Nyria Pro plan or a Premium strategy you have bought. The next alert becomes an order.

What a TradingView alert must say

Nyria needs the ticker, the side, and whether it opens or closes a position. It reads plain text or JSON in your own wording. There is no template to follow. For options, the alert says long or short. The strategy's rules pick the contract.

TradingView posts the Message box as written, plain text or JSON. Placeholders such as {{ticker}} and {{strategy.order.action}} fill in when the alert fires. One alert can serve every symbol a chart is on.

An alert cannot set the size: each bot's budget per entry does. Exits come from your exit alerts.

A stock entry

{ "ticker": "NVDA", "action": "buy" }

Buy NVDA. The alert carries no size, so each bot's budget per entry sets it.

An exit

{ "ticker": "NVDA", "action": "sell" }

Close the NVDA position, matched against what the bot is holding.

What OKX does with it

OKX connects with an API key, not a sign-in. Nyria stores the API key, secret key and passphrase encrypted at rest. Without withdrawal permission, the key can't move funds out. OKX isn't available in every country, so check OKX's terms for yours.

Options aren't offered on this connection. An options alert places no order at OKX.

Nyria trades OKX spot pairs quoted in USDT, USDC or EUR.

Each alert becomes a market order, sized by each bot's budget per entry. Nothing waits at the broker between alerts. The exit comes from your alert.

Questions

Do I need a paid TradingView plan?
Yes. TradingView sends webhooks on its paid plans only, with two-factor sign-in turned on. Nyria itself is free to test on paper, with no card.
Does Nyria hold my OKX login?
No. An OKX API key doesn't need your password. Nyria stores the API key, secret key and passphrase encrypted at rest.
Who sets the size of an OKX order?
The bot does. Each bot sizes its orders from its budget per entry, and an alert never sets the size.
How fast does an alert become an order?
Sub-second, alert to order.

From the sources

Next

Send your first TradingView alert

Trade and test free on paper. No card required.