list_trades
Retrieve recent trades from your Oanda account with filters for state, instrument, and trade ID. Get details like entry price, current units, and realized/unrealized profit or loss.
Instructions
List trades on the configured account, most recent first.
Returns {"trades": [...], "lastTransactionID": "..."}. Each trade
has id, instrument, price (entry fill, decimal string),
openTime (RFC3339), state, initialUnits and
currentUnits (decimal strings whose sign gives direction:
positive = long, negative = short), realizedPL, unrealizedPL,
marginUsed (decimal strings in the account's home currency), and —
when attached — the dependent orders takeProfitOrder,
stopLossOrder, and trailingStopLossOrder (each with id and
price or distance). Closed trades additionally carry
averageClosePrice and closeTime.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_trades"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of trades to return (API maximum 500). | |
| state | No | Trade state to filter by. | OPEN |
| before_id | No | Maximum trade ID to return (pagination cursor). Omit to start from the most recent trades; pass the smallest ID from the previous page to fetch older trades. | |
| instrument | No | Only return trades for this instrument, e.g. 'EUR_USD'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||