get_position
Retrieve the current position for a single instrument in your OANDA account. Shows open or flat status, units, average price, realized and unrealized P/L, and margin used.
Instructions
Get the account's position for one instrument (open or flat).
Returns {"position": {...}, "lastTransactionID": "..."}. The
position has instrument, lifetime realized pl,
unrealizedPL, marginUsed, financing (decimal strings in
the home currency), and long/short sides with units
(decimal string; negative on the short side, "0" when flat),
averagePrice (only while open), tradeIDs, pl, and
unrealizedPL. Requesting an instrument the account has never
traded fails with HTTP 404.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"instrument": "<instrument>"
},
"name": "get_position"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instrument | Yes | Instrument name, e.g. 'EUR_USD' or 'EU50_EUR'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||