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.
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 | |||