# OANDA trading API (v20)

Independent and unofficial. Not affiliated with or endorsed by any broker or platform named here. Educational only: nothing here is advice, and nothing here recommends a broker or a trade.

This is the markdown version of https://openbrokerapi.com/brokers/oanda, written from the same records as that page.

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

v20 REST API with HTTP streaming for prices and transactions.

- Kind: Broker API
- Newest reading: 2026-10-12
- Official documentation: [developer.oanda.com](https://developer.oanda.com/rest-live-v20/introduction/)
- Everything recorded for OANDA, as one JSON file: https://openbrokerapi.com/data/brokers/oanda.json
- Quickstart, key to first call: https://openbrokerapi.com/brokers/oanda/quickstart

## OANDA API rate limits and allowances

One record per limit. The scope is part of the limit: a figure without its scope is not a figure you can pace against.

- Headline limit: 120/s per IP address, HTTP 429 above it
  - Scope: ip
  - Status: verified. Source: [developer.oanda.com](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-03.
  - Note: Best practices. Also 2 new connections a second. The development guide separately states 120 requests a second per IP address, read 24 Sep 2026; the two figures are in different units and neither replaces the other.

[OANDA API rate limits in full](https://openbrokerapi.com/brokers/oanda/rate-limits), with the related error codes.

## Access, authentication and streaming

- How you get a key: Account Management Portal > My Services > Manage API Access, accept licence, generate personal access token.
  - Status: verified. Source: [OANDA v20 Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.
- Who can use it: Needs a v20 account; available in all divisions except OANDA Global Markets and OANDA TMS Brokers S.A.
  - Status: verified. Source: [OANDA v20 Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.
- Demo: Yes: fxTrade Practice environment with its own token.
  - Status: verified. Source: [OANDA Development Guide](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-12.
- Authentication: Bearer personal access token, generated in the Account Management Portal after accepting the API licence.
  - Status: verified. Source: [Introduction, OANDA v20 REST API](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.
- Streaming: HTTP chunked transfer encoding carrying JSON objects, not WebSocket. The development guide states at most 20 active streams, with requests above that rejected, and no more than 2 new connections a second. The best practices page advises no more than 100 requests a second on an established connection. Sources: https://developer.oanda.com/rest-live-v20/development-guide/ and https://developer.oanda.com/rest-live-v20/best-practices/, both read 23 September 2026, development guide re-read 24 September 2026.
  - Status: verified. Source: [OANDA Development Guide](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-12.
- History depth: Historical pricing back to 2005, on the introduction page. Candles: at most 5,000 per request, 500 by default, on the pricing endpoints page. Transactions: at most 365 days per request, in pages of up to 1,000.
  - Status: verified. Source: [OANDA v20: Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.
  - Status: verified. Source: [OANDA v20: Pricing endpoints](https://developer.oanda.com/rest-live-v20/pricing-ep/), checked 2026-10-12.
  - Status: verified. Source: [OANDA v20: Transaction endpoints](https://developer.oanda.com/rest-live-v20/transaction-ep/), checked 2026-10-12.
- Rate limits, as worded: OANDA publishes two figures, on two pages, in two units. The enforced one is on the development guide. The development guide states 120 requests a second per IP address, with HTTP 429 above that, and at most 20 active streams. The best practices page advises no more than 100 requests a second on an established connection and no more than 2 new connections a second. A request rate and an established connection rate are different units, so neither figure replaces or contradicts the other. Our inference and not OANDA's word: hold to the lower request rate and open no more than 2 new connections a second. Sources: https://developer.oanda.com/rest-live-v20/development-guide/ and https://developer.oanda.com/rest-live-v20/best-practices/, both read 23 September 2026, development guide re-read 24 September 2026.
  - Status: verified. Source: [OANDA v20 best practices](https://developer.oanda.com/rest-live-v20/best-practices/), checked 2026-10-12.

## OANDA API endpoints

33 documented endpoints. [Grouped by what they do](https://openbrokerapi.com/brokers/oanda/endpoints).

- [GET /v3/accounts](https://openbrokerapi.com/brokers/oanda/endpoints/accounts): List every account your token can access. Start here to find your accountID.
- [GET /v3/accounts/{accountID}](https://openbrokerapi.com/brokers/oanda/endpoints/account): Full account state: balance, NAV, margin, plus open trades, positions and pending orders.
- [GET /v3/accounts/{accountID}/candles/latest](https://openbrokerapi.com/brokers/oanda/endpoints/candles-latest): The candle still forming and the most recently completed ones, for several combinations of instrument, granularity and price component in one call.
- [GET /v3/accounts/{accountID}/changes](https://openbrokerapi.com/brokers/oanda/endpoints/account-changes): Poll an account for its current state and for what has changed since a transaction you name. This is the documented way to keep a local copy of an account up to date.
- [PATCH /v3/accounts/{accountID}/configuration](https://openbrokerapi.com/brokers/oanda/endpoints/patch-account-configuration): Change the parts of an account its owner may set: the alias and the margin rate.
- [GET /v3/accounts/{accountID}/instruments](https://openbrokerapi.com/brokers/oanda/endpoints/instruments): Instruments this account can trade, with precision, pip location and margin rate.
- [GET /v3/accounts/{accountID}/instruments/{instrument}/candles](https://openbrokerapi.com/brokers/oanda/endpoints/account-instrument-candles): Historical candlesticks for one instrument, requested through an account. Up to 5000 candles per request.
- [GET /v3/accounts/{accountID}/openPositions](https://openbrokerapi.com/brokers/oanda/endpoints/open-positions): Positions with open trades, netted per instrument with long and short sides.
- [GET /v3/accounts/{accountID}/openTrades](https://openbrokerapi.com/brokers/oanda/endpoints/open-trades): All open trades on the account.
- [GET /v3/accounts/{accountID}/orders](https://openbrokerapi.com/brokers/oanda/endpoints/orders): List orders, pending by default. Filter by ids, state or instrument; paginate with beforeID.
- [POST /v3/accounts/{accountID}/orders](https://openbrokerapi.com/brokers/oanda/endpoints/post-orders): Create an order. Market, limit, stop, market if touched and dependent orders all go through this one endpoint. Returns 201.
- [GET /v3/accounts/{accountID}/orders/{orderSpecifier}](https://openbrokerapi.com/brokers/oanda/endpoints/order): The details of one order on the account, whatever its state.
- [PUT /v3/accounts/{accountID}/orders/{orderSpecifier}](https://openbrokerapi.com/brokers/oanda/endpoints/put-order): Replace a pending order: the old order is cancelled and a new one created from the specification you send, in a single call. Returns 201.
- [PUT /v3/accounts/{accountID}/orders/{orderSpecifier}/cancel](https://openbrokerapi.com/brokers/oanda/endpoints/put-order-cancel): Cancel a pending order by ID or by your client ID prefixed with @.
- [PUT /v3/accounts/{accountID}/orders/{orderSpecifier}/clientExtensions](https://openbrokerapi.com/brokers/oanda/endpoints/put-order-client-extensions): Update the client extensions on an order: your own ID, tag and comment, for the order and for the trade it will open. OANDA says not to use them on an account linked to MT4.
- [GET /v3/accounts/{accountID}/pendingOrders](https://openbrokerapi.com/brokers/oanda/endpoints/pending-orders): Every pending order on the account, in one call with no filters.
- [GET /v3/accounts/{accountID}/positions](https://openbrokerapi.com/brokers/oanda/endpoints/positions): Every position the account has ever held, one per instrument, including those now flat. For open positions only there is a separate call.
- [GET /v3/accounts/{accountID}/positions/{instrument}](https://openbrokerapi.com/brokers/oanda/endpoints/position): The position in one instrument on the account, whether it is open or not.
- [PUT /v3/accounts/{accountID}/positions/{instrument}/close](https://openbrokerapi.com/brokers/oanda/endpoints/put-position-close): Close out the long side, the short side or both for one instrument.
- [GET /v3/accounts/{accountID}/pricing](https://openbrokerapi.com/brokers/oanda/endpoints/pricing): Current bid and ask for a list of instruments. A snapshot, not a stream.
- [GET /v3/accounts/{accountID}/pricing/stream](https://openbrokerapi.com/brokers/oanda/endpoints/pricing-stream): Streaming prices over one long lived HTTP connection. Newline delimited JSON: PRICE and HEARTBEAT objects.
- [GET /v3/accounts/{accountID}/summary](https://openbrokerapi.com/brokers/oanda/endpoints/account-summary): Account summary without the trade, position and order lists. Cheap balance and margin check.
- [GET /v3/accounts/{accountID}/trades](https://openbrokerapi.com/brokers/oanda/endpoints/trades): Trades on the account, filtered by state, instrument or ID. Open trades are returned unless you ask for another state.
- [GET /v3/accounts/{accountID}/trades/{tradeSpecifier}](https://openbrokerapi.com/brokers/oanda/endpoints/trade): The details of one trade on the account.
- [PUT /v3/accounts/{accountID}/trades/{tradeSpecifier}/clientExtensions](https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-client-extensions): Update the client extensions on a trade: your own ID, tag and comment. OANDA says not to use them on an account linked to MT4.
- [PUT /v3/accounts/{accountID}/trades/{tradeSpecifier}/close](https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-close): Close a trade in full or in part.
- [PUT /v3/accounts/{accountID}/trades/{tradeSpecifier}/orders](https://openbrokerapi.com/brokers/oanda/endpoints/put-trade-orders): Create, replace or cancel the orders that hang off a trade: take profit, stop loss, trailing stop loss and guaranteed stop loss. This is how a stop or limit is moved on an open trade.
- [GET /v3/accounts/{accountID}/transactions](https://openbrokerapi.com/brokers/oanda/endpoints/transactions): Transaction history for a time range, returned as page URLs to fetch next.
- [GET /v3/accounts/{accountID}/transactions/{transactionID}](https://openbrokerapi.com/brokers/oanda/endpoints/transaction): The details of one transaction on the account, by its ID.
- [GET /v3/accounts/{accountID}/transactions/idrange](https://openbrokerapi.com/brokers/oanda/endpoints/transactions-idrange): The transactions between two transaction IDs, both included, returned in full.
- [GET /v3/accounts/{accountID}/transactions/sinceid](https://openbrokerapi.com/brokers/oanda/endpoints/transactions-sinceid): Every transaction newer than the one you name, returned in full. Useful for catching up after a gap.
- [GET /v3/accounts/{accountID}/transactions/stream](https://openbrokerapi.com/brokers/oanda/endpoints/transactions-stream): Streaming account activity (fills, cancels, funding) from the moment you connect. Newline delimited JSON.
- [GET /v3/instruments/{instrument}/candles](https://openbrokerapi.com/brokers/oanda/endpoints/candles): Historical candlesticks (OHLC) for one instrument. Up to 5000 candles per request.

## OANDA API error codes

242 decoded error codes. [All OANDA errors](https://openbrokerapi.com/errors/oanda).

- [Account not tradable](https://openbrokerapi.com/errors/oanda/account-not-tradable): The token is valid but the account cannot trade.
- [ACCOUNT_CONFIGURATION_LOCKED](https://openbrokerapi.com/errors/oanda/account-configuration-locked): The account is locked for configuration changes.
- [ACCOUNT_DEPOSIT_LOCKED](https://openbrokerapi.com/errors/oanda/account-deposit-locked): The account is locked for deposits.
- [ACCOUNT_LOCKED](https://openbrokerapi.com/errors/oanda/account-locked): The account is locked.
- [ACCOUNT_NEW_POSITIONS_LOCKED](https://openbrokerapi.com/errors/oanda/account-new-positions-locked): The order was to be filled, but the account is configured not to allow new positions to be created.
- [ACCOUNT_NOT_ACTIVE](https://openbrokerapi.com/errors/oanda/account-not-active): The account is not active.
- [ACCOUNT_ORDER_CANCEL_LOCKED](https://openbrokerapi.com/errors/oanda/account-order-cancel-locked): The account is locked for order cancellation.
- [ACCOUNT_ORDER_CREATION_LOCKED](https://openbrokerapi.com/errors/oanda/account-order-creation-locked): The account is locked for order creation.
- [ACCOUNT_ORDER_FILL_LOCKED](https://openbrokerapi.com/errors/oanda/account-order-fill-locked): The order could not be filled because the account is locked for filling orders.
- [ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED](https://openbrokerapi.com/errors/oanda/account-position-value-limit-exceeded): Filling the order would have taken the account past the maximum position value it is allowed, so the order was cancelled.
- [ACCOUNT_WITHDRAWAL_LOCKED](https://openbrokerapi.com/errors/oanda/account-withdrawal-locked): The account is locked for withdrawals.
- [ADMIN_CONFIGURE_DATA_MISSING](https://openbrokerapi.com/errors/oanda/admin-configure-data-missing): No configuration parameters were provided.
- [ALIAS_INVALID](https://openbrokerapi.com/errors/oanda/alias-invalid): The account alias string provided is not valid.
- [AMOUNT_INVALID](https://openbrokerapi.com/errors/oanda/amount-invalid): Funding is not possible because the transfer amount requested is not valid.
- [AMOUNT_MISSING](https://openbrokerapi.com/errors/oanda/amount-missing): The funding amount was not specified.
- [BOUNDS_VIOLATION](https://openbrokerapi.com/errors/oanda/bounds-violation): Filling the order would have broken the order's price bound.
- [CLIENT_CONFIGURE_DATA_MISSING](https://openbrokerapi.com/errors/oanda/client-configure-data-missing): No configuration parameters were provided.
- [CLIENT_EXTENSIONS_DATA_MISSING](https://openbrokerapi.com/errors/oanda/client-extensions-data-missing): Neither order client extensions nor trade on fill client extensions were provided for the modification.
- [CLIENT_ORDER_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/client-order-comment-invalid): The client order comment specified is not valid.
- [CLIENT_ORDER_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/client-order-id-already-exists): The client order ID is already assigned to another pending order.
- [CLIENT_ORDER_ID_INVALID](https://openbrokerapi.com/errors/oanda/client-order-id-invalid): The client order ID specified is not valid.
- [CLIENT_ORDER_TAG_INVALID](https://openbrokerapi.com/errors/oanda/client-order-tag-invalid): The client order tag specified is not valid.
- [CLIENT_TRADE_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/client-trade-comment-invalid): The client trade comment is not valid.
- [CLIENT_TRADE_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/client-trade-id-already-exists): The client trade ID is already assigned to another open trade.
- [CLIENT_TRADE_ID_INVALID](https://openbrokerapi.com/errors/oanda/client-trade-id-invalid): The client trade ID specified is not valid.
- [CLIENT_TRADE_TAG_INVALID](https://openbrokerapi.com/errors/oanda/client-trade-tag-invalid): The client trade tag specified is not valid.
- [CLOSE_TRADE_PARTIAL_UNITS_MISSING](https://openbrokerapi.com/errors/oanda/close-trade-partial-units-missing): The request to close a trade partially did not give the number of units to close.
- [CLOSE_TRADE_TYPE_MISSING](https://openbrokerapi.com/errors/oanda/close-trade-type-missing): The request to close a trade does not say whether the close is full or partial.
- [CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE](https://openbrokerapi.com/errors/oanda/close-trade-units-exceed-trade-size): The request to close part of a trade names more units than the trade currently has.
- [CLOSEOUT_POSITION_DOESNT_EXIST](https://openbrokerapi.com/errors/oanda/closeout-position-doesnt-exist): The position asked to be closed out does not exist.
- [CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION](https://openbrokerapi.com/errors/oanda/closeout-position-incomplete): The request to close out a position was specified incompletely.
- [CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING](https://openbrokerapi.com/errors/oanda/closeout-position-units-missing): The request to close out part of a position did not give the number of units to close.
- [CLOSEOUT_POSITION_REJECT](https://openbrokerapi.com/errors/oanda/closeout-position-reject): The request to close out a position could not be fully satisfied.
- [CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE](https://openbrokerapi.com/errors/oanda/closeout-position-units-exceed): A partial position closeout names more units than the position currently has.
- [FIFO_VIOLATION](https://openbrokerapi.com/errors/oanda/fifo-violation): Filling the order would have resulted in a FIFO violation.
- [FIFO_VIOLATION_SAFEGUARD_PARTIAL_CLOSE_VIOLATION](https://openbrokerapi.com/errors/oanda/fifo-safeguard-partial-close): Filling the order would have reduced an existing trade so that the reduced trade breaks the FIFO violation safeguard constraints.
- [FIFO_VIOLATION_SAFEGUARD_VIOLATION](https://openbrokerapi.com/errors/oanda/fifo-violation-safeguard-violation): Filling the order would have created a trade that breaks the FIFO violation safeguard constraints.
- [FUNDING_REASON_MISSING](https://openbrokerapi.com/errors/oanda/funding-reason-missing): The funding reason was not specified.
- [GUARANTEED_STOP_LOSS_ON_FILL_ASK_HALTED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-ask-halted): Filling the order would create a guaranteed stop loss order on a short trade, which would be long, while the ask side is halted.
- [GUARANTEED_STOP_LOSS_ON_FILL_BID_HALTED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-bid-halted): Filling the order would create a guaranteed stop loss order on a long trade, which would be short, while the bid side is halted.
- [GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-cl-order-comment-invalid): The client order comment on the guaranteed stop loss on fill is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/gsl-on-fill-cl-order-id-exists): Filling the order would have created a guaranteed stop loss order with a client order ID that is already in use.
- [GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-client-order-id-invalid): The client order ID on the guaranteed stop loss on fill is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-client-order-tag-invalid): The client order tag on the guaranteed stop loss on fill is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-distance-invalid): The guaranteed stop loss on fill distance is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-distance-precision): The guaranteed stop loss on fill distance carries more precision than the instrument allows.
- [GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST](https://openbrokerapi.com/errors/oanda/gsl-on-fill-gtd-timestamp-in-past): The guaranteed stop loss on fill gives a GTD timestamp that is in the past.
- [GUARANTEED_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING](https://openbrokerapi.com/errors/oanda/gsl-on-fill-gtd-timestamp-missing): The guaranteed stop loss on fill has a GTD TimeInForce but no GTD timestamp.
- [GUARANTEED_STOP_LOSS_ON_FILL_HEDGING_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-hedging-not-allowed): Filling the order would create a guaranteed stop loss order for a hedged trade, and the account's configuration does not allow that.
- [GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-level-price-range): Filling the order would create a guaranteed stop loss order whose trigger price breaks the account's level restriction price range for guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ON_FILL_LEVEL_RESTRICTION_VOLUME_EXCEEDED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-level-volume-exceeded): Filling the order would create a guaranteed stop loss order whose number of units breaks the account's level restriction volume for guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ON_FILL_LOSS](https://openbrokerapi.com/errors/oanda/guaranteed-stop-loss-on-fill-loss): Filling the order would create a guaranteed stop loss order that would be filled immediately, closing the new trade at a loss.
- [GUARANTEED_STOP_LOSS_ON_FILL_MINIMUM_DISTANCE_NOT_MET](https://openbrokerapi.com/errors/oanda/gsl-on-fill-minimum-distance-not-met): The distance between the guaranteed stop loss on fill's price and the pending order's price is less than the account's configured minimum guaranteed stop loss distance.
- [GUARANTEED_STOP_LOSS_ON_FILL_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-not-allowed): A guaranteed stop loss on fill was sent, but the account's configuration does not allow guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING](https://openbrokerapi.com/errors/oanda/gsl-on-fill-price-dist-both-missing): The guaranteed stop loss on fill contains neither the price field nor the distance field.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-price-dist-both-given): The guaranteed stop loss on fill contains both the price field and the distance field.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-distance-max-exceeded): The guaranteed stop loss on fill price distance is more than the maximum allowed.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-price-invalid): The guaranteed stop loss on fill gives a price that is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_MISSING](https://openbrokerapi.com/errors/oanda/gsl-on-fill-price-missing): The guaranteed stop loss on fill does not give a price.
- [GUARANTEED_STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-price-precision-exceeded): The guaranteed stop loss on fill gives a price with more precision than the order's instrument allows.
- [GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED](https://openbrokerapi.com/errors/oanda/gsl-on-fill-required): The account's configuration requires guaranteed stop loss orders and the order did not provide one on fill.
- [GUARANTEED_STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER](https://openbrokerapi.com/errors/oanda/gsl-on-fill-required-pending): A pending order was sent with no guaranteed stop loss on fill, and the account's configuration requires every trade to have a guaranteed stop loss order.
- [GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-time-in-force-invalid): The guaranteed stop loss on fill gives a TimeInForce that is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING](https://openbrokerapi.com/errors/oanda/gsl-on-fill-time-in-force-missing): The guaranteed stop loss on fill does not give a TimeInForce.
- [GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID](https://openbrokerapi.com/errors/oanda/gsl-on-fill-trigger-invalid): The guaranteed stop loss on fill gives a TriggerCondition that is not valid.
- [GUARANTEED_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING](https://openbrokerapi.com/errors/oanda/gsl-on-fill-trigger-missing): The guaranteed stop loss on fill does not give a TriggerCondition.
- [GUARANTEED_STOP_LOSS_ORDER_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/gslo-already-exists): A guaranteed stop loss order already exists for the trade specified.
- [GUARANTEED_STOP_LOSS_ORDER_CREATE_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-create-violation): A guaranteed stop loss order was sent while the market was open, which OANDA's page lists as a violation.
- [GUARANTEED_STOP_LOSS_ORDER_HALTED_CREATE_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-halted-create-violation): A guaranteed stop loss order was sent while the market was halted.
- [GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_CANCELABLE](https://openbrokerapi.com/errors/oanda/gslo-halted-not-cancelable): A guaranteed stop loss order could not be cancelled while the market is halted, because the account's configuration requires every trade to have one.
- [GUARANTEED_STOP_LOSS_ORDER_HALTED_NOT_REPLACEABLE](https://openbrokerapi.com/errors/oanda/gslo-halted-not-replaceable): A guaranteed stop loss order could not be cancelled and replaced while the market is halted, because the account's configuration prevents guaranteed stop loss orders from being modified.
- [GUARANTEED_STOP_LOSS_ORDER_HALTED_TIGHTEN_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-halted-tighten-violation): A guaranteed stop loss order was sent again with a tighter fill price while the market was halted.
- [GUARANTEED_STOP_LOSS_ORDER_HEDGING_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/gslo-hedging-not-allowed): A guaranteed stop loss order was sent for a hedged trade, meaning an open trade exists in the opposite direction, and the account's configuration does not allow that.
- [GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_PRICE_RANGE_EXCEEDED](https://openbrokerapi.com/errors/oanda/gslo-level-price-range-exceeded): A guaranteed stop loss order was sent that would take the account past its configured level restriction price range for guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ORDER_LEVEL_RESTRICTION_VOLUME_EXCEEDED](https://openbrokerapi.com/errors/oanda/gslo-level-volume-exceeded): A guaranteed stop loss order was sent that would take the account past its configured level restriction volume for guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ORDER_MINIMUM_DISTANCE_NOT_MET](https://openbrokerapi.com/errors/oanda/gslo-minimum-distance-not-met): A guaranteed stop loss order was sent whose trigger price is closer to the current price than the account's configured minimum guaranteed stop loss distance.
- [GUARANTEED_STOP_LOSS_ORDER_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/gslo-not-allowed): A guaranteed stop loss order was sent, but the account's configuration does not allow guaranteed stop loss orders.
- [GUARANTEED_STOP_LOSS_ORDER_NOT_CANCELABLE](https://openbrokerapi.com/errors/oanda/gslo-not-cancelable): A guaranteed stop loss order could not be cancelled while the market is open, because the account's configuration requires every trade to have one.
- [GUARANTEED_STOP_LOSS_ORDER_NOT_REPLACEABLE](https://openbrokerapi.com/errors/oanda/gslo-not-replaceable): A guaranteed stop loss order could not be cancelled and replaced while the market is open, because the account's configuration prevents guaranteed stop loss orders from being modified.
- [GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING](https://openbrokerapi.com/errors/oanda/gslo-price-and-distance-both-missing): The guaranteed stop loss order request contains neither the price field nor the distance field.
- [GUARANTEED_STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED](https://openbrokerapi.com/errors/oanda/gslo-price-and-distance-both-given): The guaranteed stop loss order request contains both the price field and the distance field.
- [GUARANTEED_STOP_LOSS_ORDER_PRICE_WITHIN_SPREAD](https://openbrokerapi.com/errors/oanda/gslo-price-within-spread): A guaranteed stop loss order was sent with a price inside the current tradeable spread.
- [GUARANTEED_STOP_LOSS_ORDER_REQUIRED](https://openbrokerapi.com/errors/oanda/guaranteed-stop-loss-order-required): A stop loss order that is not guaranteed was sent on an account that requires every stop loss order to be guaranteed.
- [GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-rmo-gslo-excludes): The guaranteed stop loss order would break the account's rule that a trade with a guaranteed stop loss order can carry no other risk management order.
- [GUARANTEED_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-rmo-exclusive): The guaranteed stop loss order would break the account's rule that only one risk management order can be attached to a trade.
- [GUARANTEED_STOP_LOSS_ORDER_TIGHTEN_VIOLATION](https://openbrokerapi.com/errors/oanda/gslo-tighten-violation): A guaranteed stop loss order was sent again with a tighter fill price while the market was open, which OANDA's page lists as a violation.
- [GUARANTEED_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD](https://openbrokerapi.com/errors/oanda/gslo-would-violate-fifo-safeguard): The guaranteed stop loss order would put its trade in breach of the FIFO violation safeguard constraints.
- [HEDGING_GSLO_VIOLATION](https://openbrokerapi.com/errors/oanda/hedging-gslo-violation): Filling the order would create a trade while an opposing, hedged trade already carries a guaranteed stop loss order.
- [HTTP 401 (invalid or missing token)](https://openbrokerapi.com/errors/oanda/401-invalid-or-missing-token): The access token is invalid or missing.
- [HTTP 405](https://openbrokerapi.com/errors/oanda/405-method-not-allowed): The endpoint was called with the wrong HTTP method.
- [HTTP 429](https://openbrokerapi.com/errors/oanda/429): OANDA returned HTTP 429 because requests arrived faster than it would accept them.
- [INSTRUMENT_ASK_HALTED](https://openbrokerapi.com/errors/oanda/instrument-ask-halted): Filling the order would use the ask, but asks are halted on the instrument, so no long orders can be filled.
- [INSTRUMENT_ASK_REDUCE_ONLY](https://openbrokerapi.com/errors/oanda/instrument-ask-reduce-only): Filling the order would need a new long trade, but the instrument is configured so that orders filled at ask prices can only reduce existing positions.
- [INSTRUMENT_BID_HALTED](https://openbrokerapi.com/errors/oanda/instrument-bid-halted): Filling the order would use the bid, but bids are halted on the instrument, so no short orders can be filled.
- [INSTRUMENT_BID_REDUCE_ONLY](https://openbrokerapi.com/errors/oanda/instrument-bid-reduce-only): Filling the order would need a new short trade, but the instrument is configured so that orders filled at bid prices can only reduce existing positions.
- [INSTRUMENT_MISSING](https://openbrokerapi.com/errors/oanda/instrument-missing): The order's instrument was not specified.
- [INSTRUMENT_NOT_TRADEABLE](https://openbrokerapi.com/errors/oanda/instrument-not-tradeable): The instrument specified cannot be traded by this account.
- [INSTRUMENT_PRICE_UNKNOWN](https://openbrokerapi.com/errors/oanda/instrument-price-unknown): OANDA's system could not determine the current price for the order's instrument.
- [INSTRUMENT_UNKNOWN](https://openbrokerapi.com/errors/oanda/instrument-unknown): The instrument specified is unknown.
- [Insufficient authorization to perform request.](https://openbrokerapi.com/errors/oanda/insufficient-authorization-to-perform-request): Usually the host (practice or live) does not match your token or account.
- [INSUFFICIENT_FUNDS](https://openbrokerapi.com/errors/oanda/insufficient-funds): The account does not have enough balance to complete the funding request.
- [INSUFFICIENT_LIQUIDITY](https://openbrokerapi.com/errors/oanda/insufficient-liquidity): The order could not be filled for want of liquidity.
- [INSUFFICIENT_MARGIN](https://openbrokerapi.com/errors/oanda/insufficient-margin): The account had too little margin for the action.
- [INTERNAL_SERVER_ERROR](https://openbrokerapi.com/errors/oanda/internal-server-error): An unexpected internal server error happened on OANDA's side.
- [Invalid value specified for 'instrument'](https://openbrokerapi.com/errors/oanda/invalid-value-specified-for-instrument): Instrument name malformed.
- [INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL](https://openbrokerapi.com/errors/oanda/invalid-reissue-partial-fill): An order that was partially filled straight away could not be reissued as a correct pending order.
- [LOSING_TAKE_PROFIT](https://openbrokerapi.com/errors/oanda/losing-take-profit): Filling the order would create a take profit order that would close the new trade at a loss when filled.
- [MARGIN_RATE_INVALID](https://openbrokerapi.com/errors/oanda/margin-rate-invalid): The margin rate provided is not valid.
- [MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT](https://openbrokerapi.com/errors/oanda/margin-rate-would-trigger-closeout): The margin rate provided would cause an immediate margin closeout, so the change was refused.
- [MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL](https://openbrokerapi.com/errors/oanda/margin-rate-would-trigger-margin-call): The margin rate provided would put the account into a margin call state, so the change was refused.
- [MARKET_HALTED](https://openbrokerapi.com/errors/oanda/market-halted): The order could not be filled because its instrument was halted.
- [MARKUP_GROUP_ID_INVALID](https://openbrokerapi.com/errors/oanda/markup-group-id-invalid): The markup group ID provided is not valid.
- [NO_SUCH_ORDER](https://openbrokerapi.com/errors/oanda/no-such-order): The order ID specified does not exist.
- [NO_SUCH_TRADE](https://openbrokerapi.com/errors/oanda/no-such-trade): Trade ID does not exist or is no longer in the recent list.
- [NO_SUCH_TRANSACTION](https://openbrokerapi.com/errors/oanda/no-such-transaction): The transaction ID specified does not exist.
- [OCA_ORDER_IDS_STOP_LOSS_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/oca-order-ids-stop-loss-not-allowed): The list of order identifiers for a One Cancels All order includes a stop loss order.
- [OPEN_TRADES_ALLOWED_EXCEEDED](https://openbrokerapi.com/errors/oanda/open-trades-allowed-exceeded): Filling the order would take the account past the maximum number of open trades it is allowed.
- [ORDER_CANCEL_WOULD_TRIGGER_CLOSEOUT](https://openbrokerapi.com/errors/oanda/order-cancel-would-trigger-closeout): Cancelling the order would cause an immediate margin closeout.
- [ORDER_DOESNT_EXIST](https://openbrokerapi.com/errors/oanda/order-doesnt-exist): The order specified does not exist.
- [ORDER_FILL_POSITION_ACTION_INVALID](https://openbrokerapi.com/errors/oanda/order-fill-position-action-invalid): The OrderFillPositionAction specified is not valid.
- [ORDER_FILL_POSITION_ACTION_MISSING](https://openbrokerapi.com/errors/oanda/order-fill-position-action-missing): The OrderFillPositionAction field was not specified.
- [ORDER_ID_UNSPECIFIED](https://openbrokerapi.com/errors/oanda/order-id-unspecified): Neither the order ID nor the client order ID was specified.
- [ORDER_IDENTIFIER_INCONSISTENCY](https://openbrokerapi.com/errors/oanda/order-identifier-inconsistency): The order ID and the client order ID given do not identify the same order.
- [ORDER_PARTIAL_FILL_OPTION_INVALID](https://openbrokerapi.com/errors/oanda/order-partial-fill-option-invalid): The order's partial fill option is not valid.
- [ORDER_PARTIAL_FILL_OPTION_MISSING](https://openbrokerapi.com/errors/oanda/order-partial-fill-option-missing): The order's partial fill option was not specified.
- [ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS](https://openbrokerapi.com/errors/oanda/orders-on-fill-dup-cl-order-ids): More than one of the orders to be created on fill carries the same client order ID.
- [ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION](https://openbrokerapi.com/errors/oanda/orders-on-fill-rmo-gslo-excludes): The orders on fill would break the account's rule that a trade with a guaranteed stop loss order can carry no other risk management order.
- [ORDERS_ON_FILL_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION](https://openbrokerapi.com/errors/oanda/orders-on-fill-rmo-exclusive): The orders on fill would break the account's rule that only one risk management order can be attached to a trade.
- [PENDING_ORDERS_ALLOWED_EXCEEDED](https://openbrokerapi.com/errors/oanda/pending-orders-allowed-exceeded): Creating or filling the order would take the account past the maximum number of pending orders it is allowed.
- [POSITION_AGGREGATION_MODE_INVALID](https://openbrokerapi.com/errors/oanda/position-aggregation-mode-invalid): The PositionAggregationMode provided is not supported or not valid.
- [POSITION_CLOSEOUT_FAILED](https://openbrokerapi.com/errors/oanda/position-closeout-failed): Closing out a position was not fully possible.
- [POSITION_SIZE_EXCEEDED](https://openbrokerapi.com/errors/oanda/position-size-exceeded): Filling the order would have taken the account past its maximum position size for the order's instrument.
- [PRICE_BOUND_INVALID](https://openbrokerapi.com/errors/oanda/price-bound-invalid): The price bound specified is not valid.
- [PRICE_BOUND_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/price-bound-precision-exceeded): The price bound carries more precision than the order's instrument allows.
- [PRICE_DISTANCE_INVALID](https://openbrokerapi.com/errors/oanda/price-distance-invalid): The price distance specified is not valid.
- [PRICE_DISTANCE_MAXIMUM_EXCEEDED](https://openbrokerapi.com/errors/oanda/price-distance-maximum-exceeded): The price distance is more than the maximum amount allowed.
- [PRICE_DISTANCE_MINIMUM_NOT_MET](https://openbrokerapi.com/errors/oanda/price-distance-minimum-not-met): The price distance is less than the minimum amount allowed.
- [PRICE_DISTANCE_MISSING](https://openbrokerapi.com/errors/oanda/price-distance-missing): The price distance was not specified.
- [PRICE_DISTANCE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/price-distance-precision-exceeded): The price distance carries more precision than the instrument allows.
- [PRICE_INVALID](https://openbrokerapi.com/errors/oanda/price-invalid): The price specified is not valid.
- [PRICE_MISSING](https://openbrokerapi.com/errors/oanda/price-missing): The price was not specified.
- [PRICE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/price-precision-exceeded): The price carries more precision than the instrument allows.
- [REPLACING_ORDER_INVALID](https://openbrokerapi.com/errors/oanda/replacing-order-invalid): The order to be replaced is of a different type from the replacing order.
- [REPLACING_TRADE_ID_INVALID](https://openbrokerapi.com/errors/oanda/replacing-trade-id-invalid): The replacing order refers to a different trade from the order being replaced.
- [STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/sl-on-fill-cl-order-comment-invalid): The client order comment on the stop loss on fill is not valid.
- [STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/sl-on-fill-cl-order-id-exists): Filling the order would have created a stop loss order with a client order ID that is already in use.
- [STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID](https://openbrokerapi.com/errors/oanda/sl-on-fill-client-order-id-invalid): The client order ID on the stop loss on fill is not valid.
- [STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID](https://openbrokerapi.com/errors/oanda/sl-on-fill-client-order-tag-invalid): The client order tag on the stop loss on fill is not valid.
- [STOP_LOSS_ON_FILL_DISTANCE_INVALID](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-distance-invalid): The stop loss on fill distance is not valid.
- [STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/sl-on-fill-distance-precision): The stop loss on fill distance carries more precision than the instrument allows.
- [STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST](https://openbrokerapi.com/errors/oanda/sl-on-fill-gtd-timestamp-in-past): The stop loss on fill gives a GTD timestamp that is in the past.
- [STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING](https://openbrokerapi.com/errors/oanda/sl-on-fill-gtd-timestamp-missing): The stop loss on fill has a GTD TimeInForce but no GTD timestamp.
- [STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-ask-halted): Filling the order would create a guaranteed stop loss order on a short trade, which would be long, while the ask side is halted.
- [STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-bid-halted): Filling the order would create a guaranteed stop loss order on a long trade, which would be short, while the bid side is halted.
- [STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-no-hedging): Filling the order would create a guaranteed stop loss order for a hedged trade, and the account's configuration does not allow that.
- [STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-level-exceeded): A guaranteed stop loss on fill was configured and the order's units are more than the account's configured level restriction volume for guaranteed stop loss orders.
- [STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-min-distance): The distance between the guaranteed stop loss on fill's price and the pending order's price is less than the account's configured minimum guaranteed stop loss distance.
- [STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-not-allowed): A stop loss on fill was explicitly set to be guaranteed, but the account's configuration does not allow guaranteed stop loss orders.
- [STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED](https://openbrokerapi.com/errors/oanda/sl-on-fill-guaranteed-required): A stop loss on fill was explicitly set to be not guaranteed, but the account's configuration requires guaranteed stop loss orders.
- [STOP_LOSS_ON_FILL_LOSS](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-loss): Filling the order would create a stop loss order that would be filled immediately, closing the new trade at a loss.
- [STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING](https://openbrokerapi.com/errors/oanda/sl-on-fill-price-dist-both-missing): The stop loss on fill contains neither the price field nor the distance field.
- [STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED](https://openbrokerapi.com/errors/oanda/sl-on-fill-price-distance-both-given): The stop loss on fill contains both the price field and the distance field.
- [STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED](https://openbrokerapi.com/errors/oanda/sl-on-fill-distance-max-exceeded): The stop loss on fill price distance is more than the maximum allowed.
- [STOP_LOSS_ON_FILL_PRICE_INVALID](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-price-invalid): The stop loss on fill gives a price that is not valid.
- [STOP_LOSS_ON_FILL_PRICE_MISSING](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-price-missing): The stop loss on fill does not give a price.
- [STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-price-precision-exceeded): Price has more decimal places than the instrument allows.
- [STOP_LOSS_ON_FILL_REQUIRED](https://openbrokerapi.com/errors/oanda/stop-loss-on-fill-required): Filling the order would not create a stop loss order, and the account's configuration requires every trade to have one.
- [STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER](https://openbrokerapi.com/errors/oanda/sl-on-fill-required-pending): A pending order was sent with no stop loss on fill, and the account's configuration requires every trade to have a stop loss order.
- [STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID](https://openbrokerapi.com/errors/oanda/sl-on-fill-time-in-force-invalid): The stop loss on fill gives a TimeInForce that is not valid.
- [STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING](https://openbrokerapi.com/errors/oanda/sl-on-fill-time-in-force-missing): The stop loss on fill does not give a TimeInForce.
- [STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID](https://openbrokerapi.com/errors/oanda/sl-on-fill-trigger-condition-invalid): The stop loss on fill gives a TriggerCondition that is not valid.
- [STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING](https://openbrokerapi.com/errors/oanda/sl-on-fill-trigger-condition-missing): The stop loss on fill does not give a TriggerCondition.
- [STOP_LOSS_ORDER_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/stop-loss-order-already-exists): A stop loss order already exists for the trade specified.
- [STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-halted-create): A guaranteed stop loss order was sent while the market was halted.
- [STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-halted-tighten): A guaranteed stop loss order was sent again with a tighter fill price while the market was halted.
- [STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-no-hedging): A guaranteed stop loss order was sent for a hedged trade, meaning an open trade exists in the opposite direction, and the account's configuration does not allow that.
- [STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-level-exceeded): A guaranteed stop loss order was sent that would take the account past its configured level restriction volume for guaranteed stop loss orders.
- [STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-min-distance): A guaranteed stop loss order was sent whose trigger price is closer to the current price than the account's configured minimum guaranteed stop loss distance.
- [STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-not-allowed): A guaranteed stop loss order was sent, but the account's configuration does not allow guaranteed stop loss orders.
- [STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD](https://openbrokerapi.com/errors/oanda/sl-order-guaranteed-within-spread): A guaranteed stop loss order was sent with a price inside the current tradeable spread.
- [STOP_LOSS_ORDER_GUARANTEED_REQUIRED](https://openbrokerapi.com/errors/oanda/stop-loss-order-guaranteed-required): A stop loss order that is not guaranteed was sent on an account that requires every stop loss order to be guaranteed.
- [STOP_LOSS_ORDER_NOT_CANCELABLE](https://openbrokerapi.com/errors/oanda/stop-loss-order-not-cancelable): A stop loss order could not be cancelled because the account's configuration requires every trade to have one.
- [STOP_LOSS_ORDER_NOT_REPLACEABLE](https://openbrokerapi.com/errors/oanda/stop-loss-order-not-replaceable): A stop loss order could not be cancelled and replaced because the account's configuration prevents stop loss orders from being modified.
- [STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING](https://openbrokerapi.com/errors/oanda/sl-order-price-distance-both-missing): The stop loss order request contains neither the price field nor the distance field.
- [STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED](https://openbrokerapi.com/errors/oanda/sl-order-price-distance-both-given): The stop loss order request contains both the price field and the distance field.
- [STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION](https://openbrokerapi.com/errors/oanda/stop-loss-order-rmo-gslo-excludes): The stop loss order would break the account's rule that a trade with a guaranteed stop loss order can carry no other risk management order.
- [STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION](https://openbrokerapi.com/errors/oanda/stop-loss-order-rmo-exclusive): The stop loss order would break the account's rule that only one risk management order can be attached to a trade.
- [STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD](https://openbrokerapi.com/errors/oanda/sl-order-violates-fifo-safeguard): The stop loss order would put its trade in breach of the FIFO violation safeguard constraints.
- [TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/tp-on-fill-cl-order-comment-invalid): The client order comment on the take profit on fill is not valid.
- [TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/tp-on-fill-cl-order-id-exists): Filling the order would have created a take profit order with a client order ID that is already in use.
- [TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID](https://openbrokerapi.com/errors/oanda/tp-on-fill-client-order-id-invalid): The client order ID on the take profit on fill is not valid.
- [TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID](https://openbrokerapi.com/errors/oanda/tp-on-fill-client-order-tag-invalid): The client order tag on the take profit on fill is not valid.
- [TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST](https://openbrokerapi.com/errors/oanda/tp-on-fill-gtd-timestamp-in-past): The take profit on fill gives a GTD timestamp that is in the past.
- [TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING](https://openbrokerapi.com/errors/oanda/tp-on-fill-gtd-timestamp-missing): The take profit on fill has a GTD TimeInForce but no GTD timestamp.
- [TAKE_PROFIT_ON_FILL_LOSS](https://openbrokerapi.com/errors/oanda/take-profit-on-fill-loss): Filling the order would create a take profit order that would be filled immediately, closing the new trade at a loss.
- [TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED](https://openbrokerapi.com/errors/oanda/tp-on-fill-distance-max-exceeded): Filling the order would create a take profit order whose price would be zero or negative because of the distance specified.
- [TAKE_PROFIT_ON_FILL_PRICE_INVALID](https://openbrokerapi.com/errors/oanda/take-profit-on-fill-price-invalid): The take profit on fill contains a price that is not valid.
- [TAKE_PROFIT_ON_FILL_PRICE_MISSING](https://openbrokerapi.com/errors/oanda/take-profit-on-fill-price-missing): The take profit on fill does not give a price.
- [TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/tp-on-fill-price-precision-exceeded): The take profit on fill gives a price with more precision than the order's instrument allows.
- [TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID](https://openbrokerapi.com/errors/oanda/tp-on-fill-time-in-force-invalid): The take profit on fill gives a TimeInForce that is not valid.
- [TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING](https://openbrokerapi.com/errors/oanda/tp-on-fill-time-in-force-missing): The take profit on fill does not give a TimeInForce.
- [TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID](https://openbrokerapi.com/errors/oanda/tp-on-fill-trigger-condition-invalid): The take profit on fill gives a TriggerCondition that is not valid.
- [TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING](https://openbrokerapi.com/errors/oanda/tp-on-fill-trigger-condition-missing): The take profit on fill does not give a TriggerCondition.
- [TAKE_PROFIT_ORDER_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/take-profit-order-already-exists): A take profit order already exists for the trade specified.
- [TAKE_PROFIT_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD](https://openbrokerapi.com/errors/oanda/tp-order-violates-fifo-safeguard): The take profit order would put its trade in breach of the FIFO violation safeguard constraints.
- [The provided request was forbidden.](https://openbrokerapi.com/errors/oanda/provided-request-was-forbidden): The account ID given is not valid.
- [The request was missing required data](https://openbrokerapi.com/errors/oanda/request-missing-required-data): One or more parameters that the request requires are missing or not valid.
- [TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST](https://openbrokerapi.com/errors/oanda/time-in-force-gtd-timestamp-in-past): The TimeInForce is GTD but the GTD timestamp is in the past.
- [TIME_IN_FORCE_GTD_TIMESTAMP_MISSING](https://openbrokerapi.com/errors/oanda/time-in-force-gtd-timestamp-missing): The TimeInForce is GTD but no GTD timestamp was given.
- [TIME_IN_FORCE_INVALID](https://openbrokerapi.com/errors/oanda/time-in-force-invalid): The TimeInForce specified is not valid.
- [TIME_IN_FORCE_MISSING](https://openbrokerapi.com/errors/oanda/time-in-force-missing): The TimeInForce field was not specified.
- [TRADE_DOESNT_EXIST](https://openbrokerapi.com/errors/oanda/trade-doesnt-exist): The trade specified does not exist.
- [TRADE_ID_UNSPECIFIED](https://openbrokerapi.com/errors/oanda/trade-id-unspecified): Neither the trade ID nor the client trade ID was specified.
- [TRADE_IDENTIFIER_INCONSISTENCY](https://openbrokerapi.com/errors/oanda/trade-identifier-inconsistency): The trade ID and the client trade ID given do not identify the same trade.
- [TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED](https://openbrokerapi.com/errors/oanda/trade-on-fill-cl-ext-not-supported): The order cannot create a new trade, so it does not support trade on fill client extensions.
- [TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-cl-order-comment-invalid): The client order comment on the trailing stop loss on fill is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/tsl-on-fill-cl-order-id-exists): Filling the order would have created a trailing stop loss order with a client order ID that is already in use.
- [TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-client-order-id-invalid): The client order ID on the trailing stop loss on fill is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-client-order-tag-invalid): The client order tag on the trailing stop loss on fill is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST](https://openbrokerapi.com/errors/oanda/tsl-on-fill-gtd-timestamp-in-past): The trailing stop loss on fill GTD timestamp is in the past.
- [TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING](https://openbrokerapi.com/errors/oanda/tsl-on-fill-gtd-timestamp-missing): The trailing stop loss on fill has a GTD TimeInForce but no GTD timestamp.
- [TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-price-distance-invalid): The trailing stop loss on fill distance is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED](https://openbrokerapi.com/errors/oanda/tsl-on-fill-distance-max-exceeded): The trailing stop loss on fill price distance is more than the maximum allowed.
- [TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET](https://openbrokerapi.com/errors/oanda/tsl-on-fill-distance-minimum-not-met): The trailing stop loss on fill price distance is less than the minimum allowed.
- [TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING](https://openbrokerapi.com/errors/oanda/tsl-on-fill-price-distance-missing): The trailing stop loss on fill does not give a distance.
- [TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/tsl-on-fill-price-distance-precision): The trailing stop loss on fill distance carries more precision than the instrument allows.
- [TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-time-in-force-invalid): The trailing stop loss on fill gives a TimeInForce that is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING](https://openbrokerapi.com/errors/oanda/tsl-on-fill-time-in-force-missing): The trailing stop loss on fill does not give a TimeInForce.
- [TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID](https://openbrokerapi.com/errors/oanda/tsl-on-fill-trigger-invalid): The trailing stop loss on fill gives a TriggerCondition that is not valid.
- [TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING](https://openbrokerapi.com/errors/oanda/tsl-on-fill-trigger-missing): The trailing stop loss on fill does not give a TriggerCondition.
- [TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS](https://openbrokerapi.com/errors/oanda/tsl-order-already-exists): A trailing stop loss order already exists for the trade specified.
- [TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_GSLO_EXCLUDES_OTHERS_VIOLATION](https://openbrokerapi.com/errors/oanda/tsl-order-rmo-gslo-excludes): The trailing stop loss order would break the account's rule that a trade with a guaranteed stop loss order can carry no other risk management order.
- [TRAILING_STOP_LOSS_ORDER_RMO_MUTUAL_EXCLUSIVITY_MUTUALLY_EXCLUSIVE_VIOLATION](https://openbrokerapi.com/errors/oanda/tsl-order-rmo-exclusive): The trailing stop loss order would break the account's rule that only one risk management order can be attached to a trade.
- [TRAILING_STOP_LOSS_ORDER_WOULD_VIOLATE_FIFO_VIOLATION_SAFEGUARD](https://openbrokerapi.com/errors/oanda/tsl-order-violates-fifo-safeguard): The trailing stop loss order would put its trade in breach of the FIFO violation safeguard constraints.
- [TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED](https://openbrokerapi.com/errors/oanda/tsl-orders-not-supported): A trailing stop loss order, or an order with a trailing stop loss on fill, was sent where OANDA's page says it may not yet be supported.
- [TRIGGER_CONDITION_INVALID](https://openbrokerapi.com/errors/oanda/trigger-condition-invalid): The TriggerCondition specified is not valid.
- [TRIGGER_CONDITION_MISSING](https://openbrokerapi.com/errors/oanda/trigger-condition-missing): The TriggerCondition field was not specified.
- [UNITS_INVALID](https://openbrokerapi.com/errors/oanda/units-invalid): The order units specified are not valid.
- [UNITS_LIMIT_EXCEEDED](https://openbrokerapi.com/errors/oanda/units-limit-exceeded): The units in the request are more than the maximum number of units allowed.
- [UNITS_MINIMUM_NOT_MET](https://openbrokerapi.com/errors/oanda/units-minimum-not-met): The units are fewer than the minimum number of units required.
- [UNITS_MISSING](https://openbrokerapi.com/errors/oanda/units-missing): The order's units were not specified.
- [UNITS_PRECISION_EXCEEDED](https://openbrokerapi.com/errors/oanda/units-precision-exceeded): The units carry more precision than the order's instrument allows.

## Platform APIs an account here can reach

- [MetaTrader 4 (MQL4)](https://openbrokerapi.com/platforms/metatrader-4): offered. MT4 offered. Expert Advisors allowed: 'The MetaTrader 4 platform supports Expert Advisors (EAs)'.
  - Status: verified. Source: [OANDA UK MetaTrader 4](https://www.oanda.com/uk-en/trading/platforms/metatrader-4/), checked 2026-09-18.
- [MetaTrader 5 (Python package and MQL5)](https://openbrokerapi.com/platforms/metatrader-5): offered. MT5 on web, desktop and mobile, live and demo. Expert Advisors allowed: 'Create expert advisors in MQL5 to automate your trading strategies'.
  - Status: verified. Source: [OANDA UK MetaTrader 5](https://www.oanda.com/uk-en/trading/platforms/metatrader-5/), checked 2026-09-18.
- [cTrader Open API](https://openbrokerapi.com/platforms/ctrader): not offered. cTrader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [OANDA UK trading platforms](https://www.oanda.com/uk-en/trading/platforms/), checked 2026-09-18.
- [TradeLocker API](https://openbrokerapi.com/platforms/tradelocker): not offered. TradeLocker not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [OANDA UK trading platforms](https://www.oanda.com/uk-en/trading/platforms/), checked 2026-09-18.
- [Match-Trader Platform API](https://openbrokerapi.com/platforms/match-trader): not offered. Match-Trader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [OANDA UK trading platforms](https://www.oanda.com/uk-en/trading/platforms/), checked 2026-09-18.
- [DXtrade APIs](https://openbrokerapi.com/platforms/dxtrade): not offered. DXtrade not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.
  - Status: unverified. Source: [OANDA UK trading platforms](https://www.oanda.com/uk-en/trading/platforms/), checked 2026-09-18.

## OANDA API SDKs and wrappers

- v20 (Python, Official)
  - Status: unverified. Source: [github.com](https://github.com/oanda/v20-python), no checked date recorded.
- oandapyV20 (Python, Community): Community wrapper, last release 0.7.2 in Aug 2021.
  - Status: verified. Source: [github.com](https://github.com/hootnot/oanda-api-v20), checked 2026-09-18.

## OANDA API: questions and answers

### Does OANDA have an API?

Yes. This register records OANDA as having its own API (REST (v20) and HTTP streaming), with availability marked as active. v20 REST API with HTTP streaming for prices and transactions.

- Status: verified. Source: [OANDA: v20 REST introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.

### OANDA API key: how do I get one?

Account Management Portal > My Services > Manage API Access, accept licence, generate personal access token.

- Status: verified. Source: [OANDA v20 Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.

### Who can use the OANDA API?

Needs a v20 account; available in all divisions except OANDA Global Markets and OANDA TMS Brokers S.A.

- Status: verified. Source: [OANDA v20 Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.

### OANDA API demo: is there a demo or sandbox?

Yes: fxTrade Practice environment with its own token.

- Status: verified. Source: [OANDA Development Guide](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-12.

### What are the OANDA API rate limits?

Headline limit: 120/s per IP address, HTTP 429 above it. Scope: ip. As the record words it: OANDA publishes two figures, on two pages, in two units. The enforced one is on the development guide. The development guide states 120 requests a second per IP address, with HTTP 429 above that, and at most 20 active streams.

- Status: verified. Source: [developer.oanda.com](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-03.
- Status: verified. Source: [OANDA v20 best practices](https://developer.oanda.com/rest-live-v20/best-practices/), checked 2026-10-12.

### How does OANDA API authentication work?

Bearer personal access token, generated in the Account Management Portal after accepting the API licence.

- Status: verified. Source: [Introduction, OANDA v20 REST API](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.

### Does the OANDA API support streaming?

HTTP chunked transfer encoding carrying JSON objects, not WebSocket. The development guide states at most 20 active streams, with requests above that rejected, and no more than 2 new connections a second.

- Status: verified. Source: [OANDA Development Guide](https://developer.oanda.com/rest-live-v20/development-guide/), checked 2026-10-12.

### How much history does the OANDA API return?

Historical pricing back to 2005, on the introduction page. Candles: at most 5,000 per request, 500 by default, on the pricing endpoints page. Transactions: at most 365 days per request, in pages of up to 1,000.

- Status: verified. Source: [OANDA v20: Introduction](https://developer.oanda.com/rest-live-v20/introduction/), checked 2026-10-12.
- Status: verified. Source: [OANDA v20: Pricing endpoints](https://developer.oanda.com/rest-live-v20/pricing-ep/), checked 2026-10-12.
- Status: verified. Source: [OANDA v20: Transaction endpoints](https://developer.oanda.com/rest-live-v20/transaction-ep/), checked 2026-10-12.

### Is there a Python library for the OANDA API?

This register lists these Python libraries for the OANDA API. v20 (official, Python). oandapyV20 (community, Python): Community wrapper, last release 0.7.2 in Aug 2021.

- Status: verified. Source: [oandapyV20](https://github.com/hootnot/oanda-api-v20), checked 2026-09-18.

### Which platform APIs work with an account at OANDA?

Recorded as offered, with a source: MetaTrader 4 and MetaTrader 5. Not verified either way: cTrader, TradeLocker, Match-Trader and DXtrade.

- Status: verified. Source: [OANDA UK MetaTrader 4](https://www.oanda.com/uk-en/trading/platforms/metatrader-4/), checked 2026-09-18.
- Status: verified. Source: [OANDA UK MetaTrader 5](https://www.oanda.com/uk-en/trading/platforms/metatrader-5/), checked 2026-09-18.

[OANDA API questions, each answered in a sentence or two](https://openbrokerapi.com/answers/oanda).

## Partner programme

Published figure, as the page words it: up to US$600\* for every client you successfully introduce to us. [The OANDA partner programme record](https://openbrokerapi.com/partners/oanda). This site carries no affiliate links.

## Licence and how to cite

The limit records on this page come from the limits register, which is CC BY 4.0 (https://openbrokerapi.com/data/limits.json). Everything else on it comes from records that are all rights reserved. This file is the page itself, at its own address, in another format, and it is not part of the CC BY 4.0 downloads listed at https://openbrokerapi.com/data.

Cite as: OANDA trading API (v20). Broker API Hub, https://openbrokerapi.com/brokers/oanda, newest check 2026-10-12.

Where you rely on a single figure, cite the source and the checked date printed beside it as well. Where this page and a broker's own documentation differ, the documentation wins.
