# get_backtest_trades

> Returns a page of a finished run's trade log, newest first within the page, with the total.

Source: https://orbitalaip.com/docs/claude-and-chatgpt/tools/get_backtest_trades

Read a run's trade log · backtests · read

> [!IMPORTANT] Disclaimer
> Backtest results are hypothetical and do not predict future performance. Nothing here is investment advice: Orbital computes the rules you supplied and recommends nothing. Orbital is not a registered investment adviser or broker-dealer. Costs are as modelled by the chosen cost profile and may differ from live trading.

## What it does

Reads a page of a finished run's trade log. Within a page the trades are newest first. `offset` is counted from the oldest trade and `total` says how many trades there are, so Claude pages by adding `limit` to `offset` until `offset` reaches `total`. For the summary it uses [get_backtest](https://orbitalaip.com/docs/claude-and-chatgpt/tools/get_backtest).

Each row is one trade: the symbol and side, the size, the entry and exit times and prices, gross and net profit and loss, the fees split by component, the return, the worst and best excursion ([MAE](https://orbitalaip.com/docs/glossary#mae) and [MFE](https://orbitalaip.com/docs/glossary#mfe)), bars held, and the [exit reason](https://orbitalaip.com/docs/glossary#exit-reason). The page holds closed trades only, and `total` counts them. A position still open at the end of the run is not in this log. Its count and profit and loss are the `open_trades` and `open_pnl` metrics of [get_backtest](https://orbitalaip.com/docs/claude-and-chatgpt/tools/get_backtest). Its row, marked at the last close, is on the strategy's **Trades** tab in Orbital.

A page holds at most 150 rows and the default is 100. Claude asks for the pages it needs rather than the whole log. It needs the read permission, which every connection has. Every project role may call it, a viewer included.

One caveat: when a run's results were released because a later run of the same version completed, the page is empty with `total` 0 and `resultsReleasedAt` set. Running the period again brings the trades back.

## Parameters

| Parameter | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| run_id | string | yes | The run id, a UUID. | 0193c2b4-9e21-7a6c-8f3d-5b7a9c1e2d48 |
| offset | integer | no | Rows to skip, counted from the oldest trade. Default 0, at least 0. Page by adding limit until offset reaches total. | 0 |
| limit | integer | no | Rows per page. Default 100, at least 1 and at most 150. total tells you how many pages there are. | 100 |

## What comes back

- `trades`: the rows of the page. Each has `seq`, `symbol`, `side` (`long` or `short`), `qty`, `entryAt`, `entryDate`, `entryPrice`, `exitAt`, `exitDate`, `exitPrice`, `grossPnl`, `netPnl`, `returnPct`, `fees` (split by component: commission, slippage and borrow), `dividends`, `maePct`, `mfePct`, `barsHeld`, `entries`, `exitReason` and `source` (the name of the entry rule that opened the trade, `entry-` and the node id when the rule has no name, or `program` for a Program strategy).

- `exitReason`: `signal`, `stop`, `target`, `trailing`, `time`, `margin_call`, `delisted`, `account_blown`, `end_of_run`, `left_universe`, `unpriced` or `left_tape`. The last three close a name that left a screened universe, went unpriced for ten sessions, or moved off the tape.

- `total`, `offset` and `limit`: the size of the log and the page that was served.

- The page's `source`: `bundle` when the page comes from the engine's log, `table` for a run imported before the log was paged.

- `resultsReleasedAt`: present when the run's results were released, which is why the page is empty.

- `disclaimer`: the backtest disclaimer, word for word.

## Try saying

- "Show me the trade log of that run."
- "Which trades were closed by the stop, and what did they cost?"
- "List the newest 20 trades of the backtest with their entry and exit prices."

## If it fails

- **No such run in this project.** — The id is wrong or the run belongs to another project. Claude takes the run id from run_backtest or from get_strategy.
- **The backtesting engine is not configured** — The run's log lives on the engine and this deployment has none configured. Nothing on your side. Contact Orbital support.
- **Backtesting is not active in this project — turn it on under Settings → Apps in Orbital, then try again** — The Backtesting app is off in the project you connected. In Orbital open Settings, then Apps, and turn Backtesting on for the project you connected.

## Related

- [Read a backtest run](https://orbitalaip.com/docs/claude-and-chatgpt/tools/get_backtest)
- [Run a backtest](https://orbitalaip.com/docs/claude-and-chatgpt/tools/run_backtest)
- [FAQ](https://orbitalaip.com/docs/claude-and-chatgpt/faq)
