Importing your trades from OKX

On Trader and Pro, connect OKX with a read-only API key and your futures, perpetual swap and spot trades appear in your Luxabit journal by themselves. How to set it up, what is imported and how trades without a stop-loss are shown.

On Trader and Pro you can connect your OKX account. Your trades then appear in your journal by themselves, marked OKX, so you spend your time on reviewing them instead of typing them over.

Trader includes 1 exchange connection and Pro up to 3, so on Pro you can connect OKX next to Bybit or Binance. If you have more connections than your plan includes (for example after switching from Pro to Trader), the oldest keep syncing and the others are paused until you disconnect one or upgrade.

Luxabit only reads. It cannot place orders, close positions or move money, and it refuses any API key that could.

Setting it up

  1. Log in on OKX and go to Profile → API keys → Create API key.
  2. Choose API trading, give the key a name and give it Read permission only. Don't tick Trade or Withdraw: Luxabit checks the key's permissions with OKX and refuses keys that can trade or withdraw.
  3. Set a passphrase and create the key.
  4. In Luxabit, open your Account page, choose OKX under Connect an exchange, choose the OKX site you log in on (Europe, Global or US: a key only works on the site where you created it) and paste the API key, secret key and passphrase.

Optionally, choose the date from which your trades are imported, for example the day you started trading to your current plan. Luxabit checks the key and imports your trades straight away.

What is imported

  • Futures and perpetual swaps (including OKX's long-dated X-Perps, shown as for example OKX:BTCUSD.XPERP): one journal trade per position, with the average entry and exit price, the size and the date and time it was opened and closed. Positions that are still open are imported as open trades and closed by a later sync.
  • Spot: OKX has no positions for spot, so Luxabit rebuilds them from your fills. A buy when you hold none of that coin opens a trade; selling closes it once less than 1% of what you bought is left. Coins you bought before the imported history are left out, so a sale of those does not appear as a trade.
  • History: trades opened from the date you chose, at most 90 days back, as far as OKX keeps them. Without a date, the full 90 days. You can change the date on your account page: an earlier date imports the trades in between straight away; a later date only applies to trades not imported yet, so delete older ones from your journal if you don't want them.
  • Size and fees: the size is in coins, so profit and loss is in the quote currency (usually USDT). Fees are the trading fees plus, for perpetuals, the net funding you paid (funding you received lowers them, down to zero). For inverse contracts (settled in the coin itself) the size is left empty, so they show no profit and loss.

Margin trading on spot is not imported.

Orders that haven't filled yet

A limit order on OKX that waits to open a trade shows in your journal as a planned trade, with the order price as its entry and the stop-loss and take-profit you attached to the order. Orders that only reduce or close a position, and spot sell orders, are left out. A planned trade from OKX doesn't expire while its order waits. At each sync:

  • Filled: the planned trade becomes the open trade, with the price and size it filled at. What you added to it (notes, tags, strategy, your answers to your own rules) stays. If the order added to a trade that was already open, the planned trade goes and that trade carries on.
  • Cancelled without a fill: the planned trade is marked skipped.
  • Changed on OKX: a new price or size is taken over.

Stop-loss and take-profit

If you placed a TP/SL order on OKX while the trade was open, Luxabit takes the first stop-loss and take-profit from it: the levels the trade started with. Your realised R is measured against that first stop.

A trade without a stop-loss shows No stop in the journal. It has no R, because there is no risk to measure the result against, and it fails "stop-loss set" in your Discipline Score. That is deliberate: trading without a stop is something your journal should show you. Did you have a mental stop that you kept to? Open the trade and fill it in; a later sync leaves it as you set it.

Moved your stop into profit? OKX keeps only the last price of a stop order, so Luxabit then only sees a stop beyond your entry and can't know where the original stop was. The journal shows Stop moved: the trade counts as "stop-loss set", but it has no R until you fill in your original stop yourself.

Keeping it up to date

The journal syncs by itself every day and whenever you open it, and you can press Sync now at any time. While a trade plan you made in the chat waits for its trade, the chat also checks every few minutes; a new trade that carries out that plan is linked to it. Each sync:

  • adds new trades and closes trades that were open;
  • adds limit orders still waiting as planned trades, turns filled ones into their trade and marks cancelled ones as skipped;
  • updates what comes from OKX: prices, size, fees and times;
  • leaves what you added alone: your stop-loss, notes, tags, strategy, playbook and your answers to your own rules.

A trade you delete from the journal is not imported again.

Your key and your data

Your API key, secret and passphrase are stored encrypted and are only used to read your trades and, for the position size calculator, the balance of your trading account, which is not stored. Disconnect on your account page deletes them; trades already imported stay in your journal. Delete the API key on OKX as well. If your plan changes to Starter, syncing stops and your imported trades stay. See Account and data.

Other exchanges and brokers

Besides OKX you can connect Bybit and Binance. Trades from any other platform you log yourself, or record with the coach; every market works that way.

← All articles

Put it into practice

Write your trading plan in Luxabit and check your next idea against it before you enter. Free to start, no credit card.

Start for free