Small API correction in the FIFO example: OANDA documents closing a trade as PUT /v3/accounts/{accountID}/trades/{tradeSpecifier}/close, rather than DELETE. The body uses units: "ALL" or a positive number of units. I would check the HTTP method before interpreting a rejection as an account-routing rule. The current reference is developer.oanda.com/rest-live-v20/trade-ep .