OKX trade history, replayed fill by fill on the chart
Export your OKX trading history as a CSV and load it into Trade Replayer. Every fill is marked on the chart, so you can see where you opened, added, trimmed and closed. Net P&L already includes fees, funding and liquidation fees. On the free plan the file is parsed in your browser and never uploaded.
Which file to export
- Trading history (recommended): one row per fill. Every add and reduce is visible, and funding and liquidation fees are attached to the position they belong to.
- Position history: one row per position, with average entry and exit prices only, so adds and trims in between can't be shown.
Both work, from either the English or the Simplified Chinese interface.
Export your trading history
- On the OKX website, open your order records and switch to Trading history.
- Choose Perpetual (swap), pick a date range and download the CSV. For a long period you can export in several parts and upload each one.
- Open the replayer. In the left sidebar, under the trader selector, click +Upload and pick the CSV.
- The replayer tells you how many fills it read and how many positions it built. Give the set a name, then click any position in the list to see it on the chart.
What you see
- Every fill at its real price and time. Opens, adds, reduces and closes are marked separately; hover a marker for its size and the position after it.
- Positions, not a fill list. Fills are grouped from open to flat; a single fill that closes a position and opens the opposite one (a flip) is split automatically.
- Real net P&L. Net P&L = realised P&L − fees − liquidation fees + funding, all taken from the export, so it matches your OKX bill line by line.
- Any timeframe and diagnostics. 1 minute to 1 day, common indicators; profit concentration, what is left without the best trades, holding time vs P&L, and long vs short.
Skip the export: sync with a read-only API key
In the replayer sidebar, click Sync OKX via API and enter a read-only API key (OKX website → profile → API → Create, tick Read only). The key is only used in your browser to call OKX directly and never passes through our server; keys with trade or withdraw permission are rejected. OKX's API covers the last 3 months (30 days on Free); use an export for older records. Tick Remember and new fills are added each time you open it.
Only need averages? Export position history
Open Position history for derivatives on the OKX website, export the CSV and upload it the same way. Each position is drawn at its average entry and exit, and net P&L = P&L + fees + funding + liquidation fees.
Privacy
Free: the file is parsed in your browser and not uploaded. When you import a trading history, your browser reads contract sizes once from OKX's public API (to convert contracts into coin amounts); your file is not sent. Pro: after you sign in the file is backed up to private cloud storage that only you can access, so you can open it on another device. Privacy policy
Questions
Some fills were left out. Why?
If a position was opened before the start of your export, its closing fills have no opening fill to attach to, so they are left out and the import tells you how many. Export from an earlier date to include the opening fills.
Why are some sizes shown in contracts?
Converting contracts into coins needs the contract size, and delisted contracts are no longer listed in OKX's public API. P&L is not affected.
Does it connect to my OKX account?
CSV import does not require access to your OKX account. If you choose API sync, your browser uses your read-only API key to read records directly from OKX; the key is not sent to our server. Keys with trading or withdrawal permissions are rejected. Trade Replayer cannot place orders or move funds.