OKX trading bot

Updated

You can backtest strategies with OKX fees and rules, and run paper and live bots on your own OKX account, on spot and USDT perpetual swaps.

What is supported

  • Spot and USDT perpetual swaps.
  • Bots read OKX's own live market data.
  • Backtests can test as OKX: its fees, order steps, leverage limits and risk tiers.
  • Demo mode uses OKX simulated trading with separate demo keys and is the default for new connections.

Set up your OKX connection

  • Create a dedicated sub-account or API key for the platform in OKX. You get three credentials: the key, the secret and the passphrase.
  • Give the key trade permission only, with no withdrawal permission.
  • Bind the key to the server IP address shown in Settings, under Connections.
  • For swaps, use an account mode that supports derivatives. The connection check explains what to change if it does not.
  • Add the three credentials in Settings, under Connections, choose demo or live, and run the connection check.

Safety on OKX

Every position gets its stop loss placed on OKX, so it stays in force even while the platform is offline. Keys that can withdraw are refused, and the platform only manages the orders and positions it placed itself.

Exchanges and markets

ExchangeMarketTrading symbolsAs of
OKXSpot4512026-10-23
OKXUSDT perpetual futures5072026-10-24

Timeframes and demo mode

ExchangeTimeframesDemo mode
OKX1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1D, 1W, 1MAvailable

Questions and answers

Can the platform withdraw from my OKX account?

No. Keys with withdrawal or transfer permission are rejected, so the platform can only place and manage trades.

Does it change trades I place myself?

No. The platform only manages the orders and positions it placed; it never touches others.

Where is the stop loss kept?

On OKX. Every position has its stop loss placed on the exchange.

Can I try it without real money?

Yes. Use demo mode, or a paper bot that trades virtual money on live OKX prices.

Why are swap sizes shown in contracts?

OKX swap orders are placed in contracts, not coins. The platform converts your size using each contract's value.