openapi: 3.0.3
info:
title: OANDA v20 API
description: The full OANDA v20 API Specification. This specification defines how
to interact with v20 Accounts, Trades, Orders, Pricing and more.
contact:
name: OANDA API Support
url: http://developer.oanda.com/rest-live-v20/introduction/
email: api@oanda.com
license:
name: MIT
url: https://github.com/oanda/v20-openapi/blob/master/LICENSE.txt
version: 3.0.25
servers:
- url: https://api-{environment}.oanda.com/v3
description: Oanda REST-V20 API
variables:
environment:
enum:
- fxpractice
- fxtrade
default: fxpractice
x-enum-varnames:
- Fxpractice
- Fxtrade
security:
- PersonalAccessToken: []
paths:
/accounts:
get:
summary: List Accounts
description: Get a list of all Accounts authorized for the provided token.
operationId: getAccounts
tags:
- Account
responses:
'200':
description: The list of authorized Accounts has been provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountsResponse'
'401':
description: Unauthorized. The endpoint being access required the client
to authenticated, however the the authentication token is invalid or has
not been provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error401'
example:
errorMessage: he provided request was forbidden.
'405':
description: Method Not Allowed. The client has attempted to access an endpoint
using an HTTP method that is not supported.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error405'
/accounts/{accountId}:
get:
summary: Account Details
description: Get the full details for a single Account that a client has access
to. Full pending Order, open Trade and open Position representations are provided.
operationId: getAccount
tags:
- Account
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: The full Account details are provided
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountResponse'
'400':
description: Bad Request. The client has provided invalid data to be processed
by the server.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error400'
example:
errorCode: STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED
errorMessage: Invalid value specified for 'precision'.
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/summary:
get:
summary: Account Summary
description: Get a summary for a single Account that a client has access to.
operationId: getAccountSummary
tags:
- Account
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: The Account summary are provided
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountSummaryResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/instruments:
get:
summary: Account Instruments
description: Get the list of tradeable instruments for the given Account. The
list of tradeable instruments is dependent on the regulatory division that
the Account is located in, thus should be the same for all Accounts owned
by a single user.
operationId: getAccountInstruments
tags:
- Account
parameters:
- $ref: '#/components/parameters/AccountId'
- name: instruments
description: List of instruments to query specifically.
in: query
schema:
type: array
items:
$ref: '#/components/schemas/InstrumentName'
style: form
explode: false
responses:
'200':
description: The list of tradeable instruments for the Account has been
provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountInstrumentsResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/configuration:
patch:
summary: Configure Account
description: Set the client-configurable portions of an Account.
operationId: configureAccount
tags:
- Account
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
requestBody:
description: Representation of the Account configuration to set
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConfigurationRequest'
responses:
'200':
description: The Account was configured successfully.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConfigurationResponse'
'400':
description: The configuration specification was invalid.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConfigurationBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'403':
description: The configuration operation was forbidden on the Account.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountConfigurationForbiddenResponse'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/changes:
get:
summary: Poll Account Updates
description: Endpoint used to poll an Account for its current state and changes
since a specified TransactionID.
operationId: getAccountChanges
tags:
- Account
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: sinceTransactionID
description: ID of the Transaction to get Account changes since.
in: query
schema:
type: integer
responses:
'200':
description: The Account state and changes are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/AccountChangesResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
'416':
description: Range Not Satisfiable. The client has specified a range that
is invalid or cannot be processed.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error416'
/instruments/{instrument}/candles:
get:
summary: Get Candlesticks
description: Fetch candlestick data for an instrument.
operationId: getInstrumentCandles
tags:
- Instrument
parameters:
- $ref: '#/components/parameters/InstrumentName'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: price
description: The Price component(s) to get candlestick data for. Can contain
any combination of the characters "M" (midpoint candles) "B" (bid candles)
and "A" (ask candles).
in: query
schema:
type: string
- name: granularity
description: The granularity of the candlesticks to fetch
in: query
schema:
$ref: '#/components/schemas/CandlestickGranularity'
- name: count
description: The number of candlesticks to return in the reponse. Count should
not be specified if both the start and end parameters are provided, as the
time range combined with the graularity will determine the number of candlesticks
to return.
in: query
schema:
type: integer
- name: from
description: The start of the time range to fetch candlesticks for.
in: query
schema:
$ref: '#/components/schemas/DateTime'
- name: to
description: The end of the time range to fetch candlesticks for.
in: query
schema:
$ref: '#/components/schemas/DateTime'
- name: smooth
description: A flag that controls whether the candlestick is "smoothed" or
not. A smoothed candlestick uses the previous candle's close price as its
open price, while an unsmoothed candlestick uses the first price from its
time range as its open price.
in: query
schema:
type: boolean
- name: includeFirst
description: A flag that controls whether the candlestick that is covered
by the from time should be included in the results. This flag enables clients
to use the timestamp of the last completed candlestick received to poll
for future candlesticks but avoid receiving the previous candlestick repeatedly.
in: query
schema:
type: boolean
- name: dailyAlignment
description: The hour of the day (in the specified timezone) to use for granularities
that have daily alignments.
in: query
schema:
type: integer
- name: alignmentTimezone
description: The timezone to use for the dailyAlignment parameter. Candlesticks
with daily alignment will be aligned to the dailyAlignment hour within the
alignmentTimezone. Note that the returned times will still be represented
in UTC.
in: query
schema:
type: string
- name: weeklyAlignment
description: The day of the week used for granularities that have weekly alignment.
in: query
schema:
type: string
responses:
'200':
description: Pricing information has been successfully provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CandlesResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/instruments/{instrument}/orderBook:
get:
summary: Get Order Book
description: Fetch an order book for an instrument.
operationId: getInstrumentOrderBook
tags:
- Instrument
parameters:
- $ref: '#/components/parameters/InstrumentName'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: time
description: The time of the snapshot to fetch. If not specified, then the
most recent snapshot is fetched.
in: query
schema:
$ref: '#/components/schemas/DateTime'
responses:
'200':
description: The order book has been successfully provided.
headers:
Content-Encoding:
$ref: '#/components/headers/ContentEncoding'
Link:
$ref: '#/components/headers/Link'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/InstrumentOrderBookResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/instruments/{instrument}/positionBook:
get:
summary: Get Position Book
description: Fetch a position book for an instrument.
operationId: getInstrumentPositionBook
tags:
- Instrument
parameters:
- $ref: '#/components/parameters/InstrumentName'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: time
description: The time of the snapshot to fetch. If not specified, then the
most recent snapshot is fetched.
in: query
schema:
$ref: '#/components/schemas/DateTime'
responses:
'200':
description: The position book has been successfully provided.
headers:
Content-Encoding:
$ref: '#/components/headers/ContentEncoding'
Link:
$ref: '#/components/headers/Link'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/InstrumentPositionBookResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/orders:
post:
summary: Create Order
description: Create an Order for an Account
operationId: createOrder
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrderRequest'
responses:
'201':
description: The Order was created as specified
headers:
Location:
$ref: '#/components/headers/Location'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrderResponse'
'400':
description: The Order specification was invalid
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrderBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'403':
description: Forbidden. The client has provided a token that does not authorize
them to perform the action implemented by the API endpoint.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error403'
example:
errorMessage: Insufficient authorization to perform request.
'404':
description: The Order or Account specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CreateOrderNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
get:
summary: List Orders
description: Get a list of Orders for an Account
operationId: getOrders
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: ids
description: List of Order IDs to retrieve
in: query
schema:
type: array
items:
type: integer
style: form
explode: false
- name: state
description: The state to filter the requested Orders by
in: query
schema:
type: string
- name: instrument
description: The instrument to filter the requested orders by
in: query
schema:
$ref: '#/components/schemas/InstrumentName'
- name: count
description: The maximum number of Orders to return
in: query
schema:
type: integer
- name: beforeID
description: The maximum Order ID to return. If not provided the most recent
Orders in the Account are returned
in: query
schema:
type: integer
responses:
'200':
description: The list of Orders requested
headers:
Link:
$ref: '#/components/headers/Link'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OrdersResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'404':
description: Not Found. The client has attempted to access an entity that
does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error404'
example:
errorCode: NO_SUCH_TRADE
errorMessage: The trade ID specified does not exist.
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/pendingOrders:
get:
summary: Pending Orders
description: List all pending Orders in an Account
operationId: getPendingOrders
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: List of pending Orders for the Account
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/PendingOrdersResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/orders/{orderSpecifier}:
get:
summary: Get Order
description: Get details for a single Order in an Account
operationId: getOrder
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/OrderSpecifier'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: The details of the Order requested
headers:
Link:
$ref: '#/components/headers/Link'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OrderResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
put:
summary: Replace Order
description: Replace an Order in an Account by simultaneously cancelling it
and creating a replacement Order
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/OrderSpecifier'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/ClientRequestId'
requestBody:
description: Specification of the replacing Order. The replacing order must
have the same type as the replaced Order.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ReplaceOrderRequest'
responses:
'201':
description: The Order was successfully cancelled and replaced
headers:
Location:
$ref: '#/components/headers/Location'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ReplaceOrderResponse'
'400':
description: The Order specification was invalid
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ReplaceOrderBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or Order specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ReplaceOrderNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/orders/{orderSpecifier}/cancel:
put:
summary: Cancel Order
description: Cancel a pending Order in an Account
operationId: cancelOrder
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/OrderSpecifier'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/ClientRequestId'
responses:
'200':
description: The Order was cancelled as specified
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CancelOrderResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or Order specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
allOf:
- type: object
properties:
orderCancelRejectTransaction:
$ref: '#/components/schemas/OrderCancelRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/orders/{orderSpecifier}/clientExtensions:
put:
summary: Set Order Extensions
description: Update the Client Extensions for an Order in an Account. Do notset,
modify, or delete clientExtensions if your account is associated with MT4.
operationId: setOrderExtensions
tags:
- Order
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/OrderSpecifier'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
requestBody:
description: Representation of the replacing Order
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderExtensionsRequest'
responses:
'200':
description: The Order's Client Extensions were successfully modified
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OrderExtensionsResponse'
'400':
description: The Order Client Extensions specification was invalid
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OrderExtensionsBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or Order specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OrderExtensionsNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/trades:
get:
summary: List Trades
description: Get a list of Trades for an Account
operationId: getTrades
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: ids
description: List of Trade IDs to retrieve.
in: query
schema:
type: array
items:
type: integer
style: form
explode: false
- name: state
description: The state to filter the requested Trades by.
in: query
schema:
type: string
- name: instrument
description: The instrument to filter the requested Trades by.
in: query
schema:
$ref: '#/components/schemas/InstrumentName'
- name: count
description: The maximum number of Trades to return.
in: query
schema:
type: integer
- name: beforeID
description: The maximum Trade ID to return. If not provided the most recent
Trades in the Account are returned.
in: query
schema:
type: integer
responses:
'200':
description: The list of Trades requested
headers:
Link:
$ref: '#/components/headers/Link'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradesResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/openTrades:
get:
summary: List Open Trades
description: Get the list of open Trades for an Account
operationId: getOpenTrades
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: The Account's list of open Trades is provided
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OpenTradeResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/trades/{tradeSpecifier}:
get:
summary: Trade Details
description: Get the details of a specific Trade in an Account
operationId: getTrade
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/TradeSpecifier'
responses:
'200':
description: The details for the requested Trade is provided
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/trades/{tradeSpecifier}/close:
put:
summary: Close Trade
description: Close (partially or fully) a specific open Trade in an Account
operationId: closeTrade
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/TradeSpecifier'
requestBody:
description: Details of how much of the open Trade to close.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CloseTradeRequest'
responses:
'200':
description: The Trade has been closed as requested
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CloseTradeResponse'
'400':
description: The Trade cannot be closed as requested.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CloseTradeBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or Trade specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/CloseTradeNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/trades/{tradeSpecifier}/clientExtensions:
put:
summary: Set Trade Client Extensions
description: Update the Client Extensions for a Trade. Do not add, update, or
delete the Client Extensions if your account is associated with MT4.
operationId: setTradeExtensions
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/TradeSpecifier'
requestBody:
description: Details of how to modify the Trade's Client Extensions.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TradeExtensionsRequest'
responses:
'200':
description: The Trade's Client Extensions have been updated as requested.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeExtensionsResponse'
'400':
description: The Trade's Client Extensions cannot be modified as requested.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeExtensionsBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or Trade specified does not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeExtensionsNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/trades/{tradeSpecifier}/orders:
put:
summary: Set Dependent Orders
description: Create, replace and cancel a Trade's dependent Orders (Take Profit,
Stop Loss and Trailing Stop Loss) through the Trade itself
operationId: setTradeOrders
tags:
- Trade
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/TradeSpecifier'
requestBody:
description: Details of how to modify the Trade's dependent Orders.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DependentTradeOrdersRequest'
responses:
'200':
description: The Trade's dependent Orders have been modified as requested.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/DependentTradeOrdersResponse'
'400':
description: The Trade's dependent Orders cannot be modified as requested.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/DependentTradeOrdersBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/positions:
get:
summary: List Positions
description: List all Positions for an Account. The Positions returned are for
every instrument that has had a position during the lifetime of an the Account.
operationId: getPositions
tags:
- Position
parameters:
- $ref: '#/components/parameters/AccountId'
responses:
'200':
description: The Account's Positions are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/PositionsResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/openPositions:
get:
summary: Open Positions
description: List all open Positions for an Account. An open Position is a Position
in an Account that currently has a Trade opened for it.
operationId: getOpenPositions
tags:
- Position
parameters:
- $ref: '#/components/parameters/AccountId'
responses:
'200':
description: The Account's open Positions are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/OpenPositionsResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/positions/{instrument}:
get:
summary: Instrument Position
description: Get the details of a single Instrument's Position in an Account.
The Position may by open or not.
operationId: getInstrumentPosition
tags:
- Position
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/InstrumentName'
responses:
'200':
description: The Position is provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/InstrumentPositionResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/positions/{instrument}/close:
put:
summary: Close Position
description: Closeout the open Position for a specific instrument in an Account.
operationId: closePosition
tags:
- Position
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- $ref: '#/components/parameters/InstrumentName'
requestBody:
description: Representation of how to close the position
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ClosePositionRequest'
responses:
'200':
description: The Position closeout request has been successfully processed.
headers:
Location:
$ref: '#/components/headers/Location'
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ClosePositionResponse'
'400':
description: The Parameters provided that describe the Position closeout
are invalid.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ClosePositionBadRequestResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
description: The Account or one or more of the Positions specified does
not exist.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/ClosePositionNotFoundResponse'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/transactions:
get:
summary: List Transactions
description: Get a list of Transactions pages that satisfy a time-based Transaction
query.
operationId: getTransactions
tags:
- Transaction
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: from
description: The starting time (inclusive) of the time range for the Transactions
being queried.
in: query
schema:
$ref: '#/components/schemas/DateTime'
- name: to
description: The ending time (inclusive) of the time range for the Transactions
being queried.
in: query
schema:
$ref: '#/components/schemas/DateTime'
- name: pageSize
description: The number of Transactions to include in each page of the results.
in: query
schema:
type: integer
- name: type
description: A filter for restricting the types of Transactions to retreive.
in: query
schema:
type: array
items:
$ref: '#/components/schemas/TransactionType'
style: form
explode: false
responses:
'200':
description: The requested time range of Transaction pages are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionsResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'403':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/post/responses/403'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
'416':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1changes/get/responses/416'
/accounts/{accountId}/transactions/{transactionId}:
get:
summary: Transaction Details
description: Get the details of a single Account Transaction.
operationId: getTransaction
tags:
- Transaction
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/TransactionId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
responses:
'200':
description: The details of the requested Transaction are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionResponse'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
/accounts/{accountId}/transactions/idrange:
get:
summary: Transaction ID Range
description: Get a range of Transactions for an Account based on the Transaction
IDs.
operationId: getTransactionIdRange
tags:
- Transaction
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: from
description: The starting Transacion ID (inclusive) to fetch.
in: query
schema:
type: integer
required: true
- name: to
description: The ending Transaction ID (inclusive) to fetch.
in: query
schema:
type: integer
required: true
- name: type
description: The filter that restricts the types of Transactions to retreive.
in: query
schema:
type: array
items:
$ref: '#/components/schemas/TransactionType'
style: form
explode: false
responses:
'200':
description: The requested time range of Transactions are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionIdRangeResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
'416':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1changes/get/responses/416'
/accounts/{accountId}/transactions/sinceid:
get:
summary: Transactions Since ID
description: Get a range of Transactions for an Account starting at (but not
including) a provided Transaction ID.
operationId: getTransactionsSince
tags:
- Transaction
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: id
description: The ID of the last Transacion fetched. This query will return
all Transactions newer than the TransactionID.
in: query
schema:
type: integer
required: true
responses:
'200':
description: The requested time range of Transactions are provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TransactionSinceIdResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
'416':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1changes/get/responses/416'
/accounts/{accountId}/pricing:
get:
summary: Current Account Prices
description: Get pricing information for a specified list of Instruments within
an Account.
operationId: getPricing
tags:
- Pricing
parameters:
- $ref: '#/components/parameters/AccountId'
- $ref: '#/components/parameters/AcceptDatetimeFormat'
- name: instruments
description: List of Instruments to get pricing for.
in: query
schema:
type: array
items:
$ref: '#/components/schemas/InstrumentName'
style: form
explode: false
required: true
- name: since
description: Date/Time filter to apply to the response. Only prices and home
conversions (if requested) with a time later than this filter (i.e. the
price has changed after the since time) will be provided, and are filtered
independently.
in: query
schema:
$ref: '#/components/schemas/DateTime'
- name: includeUnitsAvailable
description: Flag that enables the inclusion of the unitsAvailable field in
the returned Price objects.
in: query
schema:
type: boolean
- name: includeHomeConversions
description: Flag that enables the inclusion of the homeConversions field
in the returned response. An entry will be returned for each currency in
the set of all base and quote currencies present in the requested instruments
list.
in: query
schema:
type: boolean
responses:
'200':
description: Pricing information has been successfully provided.
headers:
RequestID:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/PricingResponse'
'400':
$ref: '#/paths/~1accounts~1%7BaccountId%7D/get/responses/400'
'401':
$ref: '#/paths/~1accounts/get/responses/401'
'404':
$ref: '#/paths/~1accounts~1%7BaccountId%7D~1orders/get/responses/404'
'405':
$ref: '#/paths/~1accounts/get/responses/405'
components:
securitySchemes:
PersonalAccessToken:
type: http
scheme: bearer
schemas:
Account:
description: The full details of a client's Account. This includes full open
Trade, open Position and pending Order representation.
type: object
allOf:
- $ref: '#/components/schemas/AccountSummary'
- type: object
properties:
trades:
description: The details of the Trades currently open in the Account.
type: array
items:
$ref: '#/components/schemas/TradeSummary'
positions:
description: The details all Account Positions.
type: array
items:
$ref: '#/components/schemas/Position'
orders:
description: The details of the Orders currently pending in the Account.
type: array
items:
$ref: '#/components/schemas/Order'
AccountChanges:
type: object
description: An AccountChanges Object is used to represent the changes to an
Account's Orders, Trades and Positions since a specified Account TransactionID
in the past.
properties:
ordersCreated:
type: array
description: The Orders created. These Orders may have been filled, cancelled
or triggered in the same period.
items:
$ref: '#/components/schemas/Order'
ordersCancelled:
type: array
description: The Orders cancelled.
items:
$ref: '#/components/schemas/Order'
ordersFilled:
type: array
description: The Orders filled.
items:
$ref: '#/components/schemas/Order'
ordersTriggered:
type: array
description: The Orders triggered.
items:
$ref: '#/components/schemas/Order'
tradesOpened:
type: array
description: The Trades opened.
items:
$ref: '#/components/schemas/TradeSummary'
tradesReduced:
type: array
description: The Trades reduced.
items:
$ref: '#/components/schemas/TradeSummary'
tradesClosed:
type: array
description: The Trades closed.
items:
$ref: '#/components/schemas/TradeSummary'
positions:
type: array
description: The Positions changed.
items:
$ref: '#/components/schemas/Position'
transactions:
type: array
description: The Transactions that have been generated.
items:
$ref: '#/components/schemas/Transaction'
AccountChangesState:
type: object
description: An AccountChangesState Object is used to represent an Account's
current price-dependent state. Price-dependent Account state is dependent
on OANDA's current Prices, and includes things like unrealized PL, NAV and
Trailing Stop Loss Order state.
allOf:
- $ref: '#/components/schemas/AccountState'
- properties:
orders:
type: array
description: The price-dependent state of each pending Order in the Account.
items:
$ref: '#/components/schemas/DynamicOrderState'
trades:
type: array
description: The price-dependent state for each open Trade in the Account.
items:
$ref: '#/components/schemas/CalculatedTradeState'
positions:
type: array
description: The price-dependent state for each open Position in the Account.
items:
$ref: '#/components/schemas/CalculatedPositionState'
AccountCurrency:
description: The home currency of the Account
type: string
enum:
- AUD
- CAD
- CHF
- EUR
- GBP
- HKD
- JPY
- SGD
- USD
x-enum-varnames:
- Aud
- Cad
- Chf
- Eur
- Gbp
- Hkd
- Jpy
- Sgd
- Usd
AccountGuaranteedStopLossOrderMode:
description: The current guaranteed Stop Loss Order mode of the Account.
type: string
enum:
- DISABLED
- ALLOWED
- REQUIRED
x-enum-varnames:
- Disabled
- Allowed
- Required
AccountId:
description: The Account's identifier
type: string
pattern: ^\d+-\d+-\d+-\d+$
AccountProperties:
description: Properties related to an Account.
type: object
properties:
id:
$ref: '#/components/schemas/AccountId'
mt4AccountID:
description: The Account's associated MT4 Account ID. This field will not
be present if the Account is not an MT4 account.
type: integer
tags:
description: The Account's tags
type: array
items:
type: string
AccountState:
description: An AccountState Object is used to represent an Account's current
price-dependent state. Price-dependent Account state is dependent on OANDA's
current Prices, and includes things like unrealized PL, NAV and Trailing Stop
Loss Order state.
type: object
properties:
unrealizedPL:
description: The total unrealized profit/loss for all Trades currently open
in the Account.
type: number
format: double
NAV:
description: The net asset value of the Account. Equal to Account balance
unrealizedPL.
type: number
format: double
marginUsed:
description: Margin currently used for the Account.
type: number
format: double
marginAvailable:
description: Margin available for Account currency.
type: number
format: double
positionValue:
description: The value of the Account's open positions represented in the
Account's home currency.
type: number
format: double
marginCloseoutUnrealizedPL:
description: The Account's margin closeout unrealized PL.
type: number
format: double
marginCloseoutNAV:
description: The Account's margin closeout NAV.
type: number
format: double
marginCloseoutMarginUsed:
description: The Account's margin closeout margin used.
type: number
format: double
marginCloseoutPercent:
description: The Account's margin closeout percentage. When this value is
1.0 or above the Account is in a margin closeout situation.
type: number
format: double
marginCloseoutPositionValue:
description: The value of the Account's open positions as used for margin
closeout calculations represented in the Account's home currency.
type: number
format: double
withdrawalLimit:
description: The current WithdrawalLimit for the account which will be zero
or a positive value indicating how much can be withdrawn from the account.
type: number
format: double
marginCallMarginUsed:
description: The Account's margin call margin used.
type: number
format: double
marginCallPercent:
description: The Account's margin call percentage. When this value is 1.0
or above the Account is in a margin call situation.
type: number
format: double
AccountSummary:
description: A summary representation of a client's Account. The AccountSummary
does not provide to full specification of pending Orders, open Trades and
Positions.
type: object
allOf:
- type: object
properties:
id:
$ref: '#/components/schemas/AccountId'
alias:
description: Client-assigned alias for the Account. Only provided if the
Account has an alias set
type: string
nullable: true
currency:
$ref: '#/components/schemas/AccountCurrency'
balance:
description: The current balance of the Account.
type: number
format: double
createdByUserID:
description: ID of the user that created the Account.
type: integer
createdTime:
$ref: '#/components/schemas/DateTime'
guaranteedStopLossOrderMode:
$ref: '#/components/schemas/AccountGuaranteedStopLossOrderMode'
pl:
description: The total profit/loss realized over the lifetime of the Account.
type: number
format: double
resettablePL:
description: The total realized profit/loss for the Account since it was
last reset by the client.
type: number
format: double
resettablePLTime:
$ref: '#/components/schemas/DateTime'
financing:
description: The total amount of financing paid/collected over the lifetime
of the Account.
type: number
format: double
commission:
description: The total amount of commission paid over the lifetime of
the Account.
type: number
format: double
guaranteedExecutionFees:
description: The total amount of fees charged over the lifetime of the
Account for the execution of guaranteed Stop Loss Orders.
type: number
format: double
marginRate:
description: Client-provided margin rate override for the Account. The
effective margin rate of the Account is the lesser of this value and
the OANDA margin rate for the Account's division. This value is only
provided if a margin rate override exists for the Account.
type: number
format: double
marginCallEnterTime:
$ref: '#/components/schemas/DateTime'
marginCallExtensionCount:
description: The number of times that the Account's current margin call
was extended.
type: integer
lastMarginCallExtensionTime:
$ref: '#/components/schemas/DateTime'
openTradeCount:
description: The number of Trades currently open in the Account.
type: integer
openPositionCount:
description: The number of Positions currently open in the Account.
type: integer
pendingOrderCount:
description: The number of Orders currently pending in the Account.
type: integer
hedgingEnabled:
description: Flag indicating that the Account has hedging enabled.
type: boolean
lastOrderFillTimestamp:
$ref: '#/components/schemas/DateTime'
lastTransactionId:
description: The ID of the last Transaction created for the Account.
type: integer
- $ref: '#/components/schemas/AccountState'
AccountConfigurationRequest:
type: object
properties:
alias:
description: Client-defined alias (name) for the Account
type: string
marginRate:
description: Margin rate.
type: number
format: double
AccountChangesResponse:
type: object
properties:
changes:
$ref: '#/components/schemas/AccountChanges'
state:
$ref: '#/components/schemas/AccountChangesState'
lastTransactionID:
description: The ID of the last Transaction created for the Account. This
Transaction ID should be used for future poll requests, as the client
has already observed all changes up to and including it.
type: string
AccountConfigurationBadRequestResponse:
allOf:
- type: object
properties:
clientConfigureRejectTransaction:
$ref: '#/components/schemas/ClientConfigureRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
AccountConfigurationForbiddenResponse:
allOf:
- type: object
properties:
clientConfigureRejectTransaction:
$ref: '#/components/schemas/ClientConfigureRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
AccountConfigurationResponse:
type: object
properties:
clientConfigureTransaction:
$ref: '#/components/schemas/ClientConfigureTransaction'
lastTransactionID:
description: The ID of the last Transaction created for the Account.
type: integer
AccountInstrumentsResponse:
type: object
properties:
instruments:
description: The requested list of instruments.
type: array
items:
$ref: '#/components/schemas/Instrument'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account.
type: integer
AccountResponse:
description: The response body of the account details request
type: object
properties:
account:
$ref: '#/components/schemas/Account'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account.
type: integer
AccountsResponse:
type: object
properties:
accounts:
description: The list of Accounts the client is authorized to access and
their associated properties.
type: array
items:
$ref: '#/components/schemas/AccountProperties'
AccountSummaryResponse:
type: object
properties:
account:
$ref: '#/components/schemas/AccountSummary'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account.
type: integer
Candlestick:
type: object
description: The Candlestick representation
properties:
time:
$ref: '#/components/schemas/DateTime'
bid:
$ref: '#/components/schemas/CandlestickData'
ask:
$ref: '#/components/schemas/CandlestickData'
mid:
$ref: '#/components/schemas/CandlestickData'
volume:
description: The number of prices created during the time-range represented
by the candlestick.
type: integer
complete:
description: A flag indicating if the candlestick is complete. A complete
candlestick is one whose ending time is not in the future.
type: boolean
CandlestickData:
type: object
description: The price data (open, high, low, close) for the Candlestick representation.
properties:
o:
description: The first (open) price in the time-range represented by the
candlestick.
type: number
format: double
h:
description: The highest price in the time-range represented by the candlestick.
type: number
format: double
l:
description: The lowest price in the time-range represented by the candlestick.
type: number
format: double
c:
description: The last (closing) price in the time-range represented by the
candlestick.
type: number
format: double
CandlestickGranularity:
description: The granularity of the candlesticks.
type: string
enum:
- S5
- S10
- S15
- S30
- M1
- M2
- M4
- M5
- M10
- M15
- M30
- H1
- H2
- H3
- H4
- H6
- H8
- H12
- D
- W
- M
x-enum-varnames:
- S5
- S10
- S15
- S30
- M1
- M2
- M4
- M5
- M10
- M15
- M30
- H1
- H2
- H3
- H4
- H6
- H8
- H12
- D
- W
- M
Instrument:
description: Full specification of an Instrument.
type: object
properties:
name:
$ref: '#/components/schemas/InstrumentName'
type:
$ref: '#/components/schemas/InstrumentType'
displayName:
description: The display name of the Instrument
type: string
pipLocation:
description: The location of the "pip" for this instrument. The decimal
position of the pip in this Instrument's price can be found at 10 ^ pipLocation
(e.g. -4 pipLocation results in a decimal pip position of 10 ^ -4 = 0.0001).
type: integer
displayPrecision:
description: The number of decimal places that should be used to display
prices for this instrument. (e.g. a displayPrecision of 5 would result
in a price of "1" being displayed as "1.00000")
type: integer
tradeUnitsPrecision:
description: The amount of decimal places that may be provided when specifying
the number of units traded for this instrument.
type: integer
minimumTradeSize:
description: The smallest number of units allowed to be traded for this
instrument.
type: number
format: double
maximumTrailingStopDistance:
description: The maximum trailing stop distance allowed for a trailing stop
loss created for this instrument. Specified in price units.
type: number
format: double
minimumTrailingStopDistance:
description: The minimum trailing stop distance allowed for a trailing stop
loss created for this instrument. Specified in price units.
type: number
format: double
maximumPositionSize:
description: The maximum position size allowed for this instrument. Specified
in units.
type: number
format: double
maximumOrderUnits:
description: The maximum units allowed for an Order placed for this instrument.
Specified in units.
type: number
format: double
marginRate:
description: The margin rate for this instrument.
type: number
format: double
commission:
$ref: '#/components/schemas/InstrumentComission'
InstrumentComission:
description: An InstrumentCommission represents an instrument-specific commission
type: object
properties:
commission:
description: The commission amount (in the Account's home currency) charged
per unitsTraded of the instrument
type: number
format: double
unitsTraded:
description: The number of units traded that the commission amount is based
on.
type: number
format: double
minimumCommission:
description: The minimum commission amount (in the Account's home currency)
that is charged when an Order is filled for this instrument.
type: number
format: double
InstrumentName:
description: Instrument name identifier. Used by clients to refer to an Instrument.
type: string
enum:
- AUD_CAD
- AUD_CHF
- AUD_HKD
- AUD_JPY
- AUD_NZD
- AUD_SGD
- AUD_USD
- CAD_CHF
- CAD_HKD
- CAD_JPY
- CAD_SGD
- CHF_HKD
- CHF_JPY
- CHF_ZAR
- EUR_AUD
- EUR_CAD
- EUR_CHF
- EUR_CZK
- EUR_DKK
- EUR_GBP
- EUR_HKD
- EUR_HUF
- EUR_JPY
- EUR_NOK
- EUR_NZD
- EUR_PLN
- EUR_SEK
- EUR_SGD
- EUR_TRY
- EUR_USD
- EUR_ZAR
- GBP_AUD
- GBP_CAD
- GBP_CHF
- GBP_HKD
- GBP_JPY
- GBP_NZD
- GBP_PLN
- GBP_SGD
- GBP_USD
- GBP_ZAR
- HKD_JPY
- NZD_CAD
- NZD_CHF
- NZD_HKD
- NZD_JPY
- NZD_SGD
- NZD_USD
- SGD_CHF
- SGD_HKD
- SGD_JPY
- TRY_JPY
- USD_CAD
- USD_CHF
- USD_CNH
- USD_CZK
- USD_DKK
- USD_HKD
- USD_HUF
- USD_JPY
- USD_MXN
- USD_NOK
- USD_PLN
- USD_SAR
- USD_SEK
- USD_SGD
- USD_THB
- USD_TRY
- USD_ZAR
- ZAR_JPY
x-enum-varnames:
- AudCad
- AudChf
- AudHkd
- AudJpy
- AudNzd
- AudSgd
- AudUsd
- CadChf
- CadHkd
- CadJpy
- CadSgd
- ChfHkd
- ChfJpy
- ChfZar
- EurAud
- EurCad
- EurChf
- EurCzk
- EurDkk
- EurGbp
- EurHkd
- EurHuf
- EurJpy
- EurNok
- EurNzd
- EurPln
- EurSek
- EurSgd
- EurTry
- EurUsd
- EurZar
- GbpAud
- GbpCad
- GbpChf
- GbpHkd
- GbpJpy
- GbpNzd
- GbpPln
- GbpSgd
- GbpUsd
- GbpZar
- HkdJpy
- NzdCad
- NzdChf
- NzdHkd
- NzdJpy
- NzdSgd
- NzdUsd
- SgdChf
- SgdHkd
- SgdJpy
- TryJpy
- UsdCad
- UsdChf
- UsdCnh
- UsdCzk
- UsdDkk
- UsdHkd
- UsdHuf
- UsdJpy
- UsdMxn
- UsdNok
- UsdPln
- UsdSar
- UsdSek
- UsdSgd
- UsdThb
- UsdTry
- UsdZar
- ZarJpy
InstrumentType:
description: The type of the Instrument
type: string
enum:
- CURRENCY
- CFD
- METAL
x-enum-varnames:
- Currency
- Cfd
- Metal
CandlesResponse:
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
granularity:
$ref: '#/components/schemas/CandlestickGranularity'
candles:
description: The list of candlesticks that satisfy the request.
type: array
items:
$ref: '#/components/schemas/Candlestick'
InstrumentOrderBookResponse:
type: object
properties:
orderBook:
$ref: '#/components/schemas/OrderBook'
InstrumentPositionBookResponse:
type: object
properties:
positionBook:
$ref: '#/components/schemas/PositionBook'
DynamicOrderState:
description: The dynamic state of an Order. This is only relevant to TrailingStopLoss
Orders, as no other Order type has dynamic state.
type: object
properties:
id:
description: The Order's ID.
type: integer
trailingStopValue:
description: The Order's calculated trailing stop value.
type: number
format: double
triggerDistance:
description: The distance between the Trailing Stop Loss Order's trailingStopValue
and the current Market Price. This represents the distance (in price units)
of the Order from a triggering price. If the distance could not be determined,
this value will not be set.
type: number
format: double
isTriggerDistanceExact:
description: True if an exact trigger distance could be calculated. If false,
it means the provided trigger distance is a best estimate. If the distance
could not be determined, this value will not be set.
type: boolean
Order:
description: The base Order definition specifies the properties that are common
to all Orders.
type: object
properties:
id:
description: The Order's identifier, unique within the Order's Account.
type: integer
createTime:
$ref: '#/components/schemas/DateTime'
state:
$ref: '#/components/schemas/OrderState'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
OrderBook:
description: The representation of an instrument's order book at a point in
time
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
time:
$ref: '#/components/schemas/DateTime'
price:
description: The price (midpoint) for the order book's instrument at the
time of the order book snapshot
type: number
format: double
bucketWidth:
description: The price width for each bucket. Each bucket covers the price
range from the bucket's price to the bucket's price + bucketWidth.
type: number
format: double
buckets:
description: The partitioned order book, divided into buckets using a default
bucket width. These buckets are only provided for price ranges which actually
contain order or position data.
type: array
items:
$ref: '#/components/schemas/OrderBookBucket'
OrderBookBucket:
description: The order book data for a partition of the instrument's prices.
type: object
properties:
price:
description: The lowest price (inclusive) covered by the bucket. The bucket
covers the price range from the price to price + the order book's bucketWidth.
type: number
format: double
longCountPercent:
description: The percentage of the total number of orders represented by
the long orders found in this bucket.
type: number
format: double
shortCountPercent:
description: The percentage of the total number of orders represented by
the short orders found in this bucket.
type: number
format: double
OrderRequest:
description: The base Order specification used when requesting that an Order
be created. Each specific Order-type extends this definition.
type: object
properties: {}
OrderState:
description: The current state of the Order.
type: string
enum:
- PENDING
- FILLED
- TRIGGERED
- CANCELLED
x-enum-varnames:
- Pending
- Filled
- Triggered
- Cancelled
StopLossDetails:
description: StopLossDetails specifies the details of a Stop Loss Order to be
created on behalf of a client. This may happen when an Order is filled that
opens a Trade requiring a Stop Loss, or when a Trade's dependent Stop Loss
Order is modified directly through the Trade.
type: object
properties:
price:
description: The price that the Stop Loss Order will be triggered at. Only
one of the price and distance fields may be specified.
type: number
format: double
distance:
description: Specifies the distance (in price units) from the Trade's open
price to use as the Stop Loss Order price. Only one of the distance and
price fields may be specified.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
guaranteed:
description: Flag indicating that the price for the Stop Loss Order is guaranteed.
The default value depends on the GuaranteedStopLossOrderMode of the account,
if it is REQUIRED, the default will be true, for DISABLED or ENABLED the
default is false.
type: boolean
StopLossOrder:
description: A StopLossOrder is an order that is linked to an open Trade and
created with a price threshold. The Order will be filled (closing the Trade)
by the first price that is equal to or worse than the threshold. A StopLossOrder
cannot be used to open a new Position.
type: object
allOf:
- $ref: '#/components/schemas/TradeOrderBase'
- type: object
properties:
price:
description: The price threshold specified for the Stop Loss Order. If
the guaranteed flag is false, the associated Trade will be closed by
a market price that is equal to or worse than this threshold. If the
flag is true the associated Trade will be closed at this price.
type: number
format: double
guaranteedExecutionPremium:
description: The premium that will be charged if the Stop Loss Order is
guaranteed and the Order is filled at the guaranteed price. It is in
price units and is charged for each unit of the Trade.
type: number
format: double
distance:
description: Specifies the distance (in price units) from the Account's
current price to use as the Stop Loss Order price. If the Trade is short
the Instrument's bid price is used, and for long Trades the ask is used.
type: number
format: double
guaranteed:
description: Flag indicating that the Stop Loss Order is guaranteed. The
default value depends on the GuaranteedStopLossOrderMode of the account,
if it is REQUIRED, the default will be true, for DISABLED or ENABLED
the default is false.
type: boolean
TakeProfitDetails:
description: TakeProfitDetails specifies the details of a Take Profit Order
to be created on behalf of a client. This may happen when an Order is filled
that opens a Trade requiring a Take Profit, or when a Trade's dependent Take
Profit Order is modified directly through the Trade.
type: object
properties:
price:
description: The price that the Take Profit Order will be triggered at.
Only one of the price and distance fields may be specified.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
TakeProfitOrder:
description: A TakeProfitOrder is an order that is linked to an open Trade and
created with a price threshold. The Order will be filled (closing the Trade)
by the first price that is equal to or better than the threshold. A TakeProfitOrder
cannot be used to open a new Position.
type: object
allOf:
- $ref: '#/components/schemas/TradeOrderBase'
- type: object
properties:
price:
description: "The price threshold specified for the TakeProfit Order.\
\ The associated Trade will be closed by a market price that is equal\
\ to or better\t than this threshold."
type: number
format: double
TradeOrderBase:
description: The base Order object for TakeProfit, StopLoss and TrailingStopLoss
type of orders which are connected to a trade.
type: object
allOf:
- $ref: '#/components/schemas/Order'
- type: object
properties:
type:
description: The type of the Order.
type: string
enum:
- TAKE_PROFIT
- STOP_LOSS
- TRAILING_STOP_LOSS
x-enum-varnames:
- TakeProfit
- StopLoss
- TrailingStopLoss
tradeID:
description: The ID of the Trade to close when the price threshold is
breached.
type: integer
clientTradeID:
description: The client ID of the Trade to be closed when the price threshold
is breached.
type: string
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
triggerCondition:
$ref: '#/components/schemas/TradeOrderTriggerCondition'
fillingTransactionID:
description: ID of the Transaction that filled this Order (only provided
when the Order's state is FILLED)
type: integer
filledTime:
$ref: '#/components/schemas/DateTime'
tradeOpenedID:
description: Trade ID of Trade opened when the Order was filled (only
provided when the Order's state is FILLED and a Trade was opened as
a result of the fill)
type: integer
tradeReducedID:
description: Trade ID of Trade reduced when the Order was filled (only
provided when the Order's state is FILLED and a Trade was reduced as
a result of the fill)
type: integer
tradeClosedIDs:
description: Trade IDs of Trades closed when the Order was filled (only
provided when the Order's state is FILLED and one or more Trades were
closed as a result of the fill)
type: array
items:
type: integer
description: The Trade's identifier, unique within the Trade's Account.
cancellingTransactionID:
description: ID of the Transaction that cancelled the Order (only provided
when the Order's state is CANCELLED)
type: integer
cancelledTime:
$ref: '#/components/schemas/DateTime'
replacesOrderID:
description: The ID of the Order that was replaced by this Order (only
provided if this Order was created as part of a cancel/replace).
type: integer
replacedByOrderID:
description: The ID of the Order that replaced this Order (only provided
if this Order was cancelled as part of a cancel/replace).
type: integer
TradeOrderTimeInForce:
description: The time in force for the created Stop Loss Order. This may only
be GTC, GTD or GFD.
type: string
enum:
- GTC
- GTD
- GFD
x-enum-varnames:
- Gtc
- Gtd
- Gfd
TradeOrderTriggerCondition:
description: Specification of which price component should be used when determining
if an Order should be triggered and filled. This allows Orders to be triggered
based on the bid, ask, mid, default (ask for buy, bid for sell) or inverse
(ask for sell, bid for buy) price depending on the desired behaviour. Orders
are always filled using their default price component. A special restriction
applies when creating a guaranteed Stop Loss Order. In this case the TriggerCondition
value must either be "DEFAULT", or the "natural" trigger side "DEFAULT" results
in. So for a Stop Loss Order for a long trade valid values are "DEFAULT" and
"BID", and for short trades "DEFAULT" and "ASK" are valid.
type: string
enum:
- DEFAULT
- INVERSE
- BID
- ASK
- MID
x-enum-varnames:
- Default
- Inverse
- Bid
- Ask
- Mid
TrailingStopLossDetails:
description: TrailingStopLossDetails specifies the details of a Trailing Stop
Loss Order to be created on behalf of a client. This may happen when an Order
is filled that opens a Trade requiring a Trailing Stop Loss, or when a Trade's
dependent Trailing Stop Loss Order is modified directly through the Trade.
type: object
properties:
distance:
description: The distance (in price units) from the Trade's fill price that
the Trailing Stop Loss Order will be triggered at.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
TrailingStopLossOrder:
description: A TrailingStopLossOrder is an order that is linked to an open Trade
and created with a price distance. The price distance is used to calculate
a trailing stop value for the order that is in the losing direction from the
market price at the time of the order's creation. The trailing stop value
will follow the market price as it moves in the winning direction, and the
order will filled (closing the Trade) by the first price that is equal to
or worse than the trailing stop value. A TrailingStopLossOrder cannot be used
to open a new Position.
type: object
allOf:
- $ref: '#/components/schemas/TradeOrderBase'
- type: object
properties:
distance:
description: The price distance (in price units) specified for the TrailingStopLoss
Order.
type: number
format: double
trailingStopValue:
description: The trigger price for the Trailing Stop Loss Order. The trailing
stop value will trail (follow) the market price by the TSL order's configured
"distance" as the market price moves in the winning direction. If the
market price moves to a level that is equal to or worse than the trailing
stop value, the order will be filled and the Trade will be closed.
type: number
format: double
CreateOrderRequest:
type: object
properties:
order:
$ref: '#/components/schemas/OrderRequest'
OrderExtensionsRequest:
type: object
properties:
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
tradeClientExtensions:
$ref: '#/components/schemas/ClientExtensions'
ReplaceOrderRequest:
type: object
properties:
order:
$ref: '#/components/schemas/OrderRequest'
CancelOrderResponse:
allOf:
- type: object
properties:
orderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
CreateOrderBadRequestResponse:
allOf:
- type: object
properties:
orderRejectTransaction:
$ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/Error4xxTransaction'
CreateOrderNotFoundResponse:
allOf:
- type: object
properties:
orderRejectTransaction:
$ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/Error4xxTransaction'
CreateOrderResponse:
allOf:
- type: object
properties:
orderCreateTransaction:
$ref: '#/components/schemas/Transaction'
orderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
orderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
orderReissueTransaction:
$ref: '#/components/schemas/Transaction'
orderReissueRejectTransaction:
$ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/Error4xxTransaction'
OrderExtensionsBadRequestResponse:
allOf:
- type: object
properties:
orderClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/OrderClientExtensionsModifyRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
OrderExtensionsNotFoundResponse:
allOf:
- type: object
properties:
orderClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/OrderClientExtensionsModifyRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
OrderExtensionsResponse:
allOf:
- type: object
properties:
orderClientExtensionsModifyTransaction:
$ref: '#/components/schemas/OrderClientExtensionsModifyTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
OrderResponse:
type: object
properties:
order:
$ref: '#/components/schemas/Order'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
OrdersResponse:
type: object
properties:
orders:
description: The list of Order detail objects
type: array
items:
$ref: '#/components/schemas/Order'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
PendingOrdersResponse:
type: object
properties:
orders:
description: The list of pending Order details
type: array
items:
$ref: '#/components/schemas/Order'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
ReplaceOrderBadRequestResponse:
allOf:
- type: object
properties:
orderClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/Error4xxTransaction'
ReplaceOrderNotFoundResponse:
allOf:
- type: object
properties:
orderClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/Error4xxTransaction'
ReplaceOrderResponse:
allOf:
- type: object
properties:
orderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
orderCreateTransaction:
$ref: '#/components/schemas/Transaction'
orderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
orderReissueTransaction:
$ref: '#/components/schemas/Transaction'
orderReissueRejectTransaction:
$ref: '#/components/schemas/Transaction'
replacingOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
CalculatedPositionState:
description: The dynamic (calculated) state of a Position
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
netUnrealizedPL:
description: The Position's net unrealized profit/loss
type: number
format: double
longUnrealizedPL:
description: The unrealized profit/loss of the Position's long open Trades
type: number
format: double
shortUnrealizedPL:
description: The unrealized profit/loss of the Position's short open Trades
type: number
format: double
marginUsed:
description: Margin currently used by the Position.
type: number
format: double
Position:
description: The specification of a Position within an Account.
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
pl:
description: Profit/loss realized by the Position over the lifetime of the
Account.
type: number
format: double
unrealizedPL:
description: The unrealized profit/loss of all open Trades that contribute
to this Position.
type: number
format: double
marginUsed:
type: number
format: double
description: Margin currently used by the Position.
resettablePL:
description: Profit/loss realized by the Position since the Account's resettablePL
was last reset by the client.
type: number
format: double
financing:
description: The total amount of financing paid/collected for this instrument
over the lifetime of the Account.
type: number
format: double
commission:
description: The total amount of commission paid for this instrument over
the lifetime of the Account.
type: number
format: double
guaranteedExecutionFees:
description: The total amount of fees charged over the lifetime of the Account
for the execution of guaranteed Stop Loss Orders for this instrument.
type: number
format: double
long:
$ref: '#/components/schemas/PositionSide'
short:
$ref: '#/components/schemas/PositionSide'
PositionBook:
description: The representation of an instrument's position book at a point
in time
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
time:
$ref: '#/components/schemas/DateTime'
price:
description: The price (midpoint) for the position book's instrument at
the time of the position book snapshot
type: number
format: double
bucketWidth:
description: The price width for each bucket. Each bucket covers the price
range from the bucket's price to the bucket's price + bucketWidth.
type: number
format: double
buckets:
description: The partitioned position book, divided into buckets using a
default bucket width. These buckets are only provided for price ranges
which actually contain order or position data.
type: array
items:
$ref: '#/components/schemas/PositionBookBucket'
PositionBookBucket:
description: The position book data for a partition of the instrument's prices.
type: object
properties:
price:
description: The lowest price (inclusive) covered by the bucket. The bucket
covers the price range from the price to price + the position book's bucketWidth.
type: number
format: double
longCountPercent:
description: The percentage of the total number of positions represented
by the long positions found in this bucket.
type: number
format: double
shortCountPercent:
description: The percentage of the total number of positions represented
by the short positions found in this bucket.
type: number
format: double
PositionSide:
description: The representation of a Position for a single direction (long or
short).
type: object
properties:
units:
description: Number of units in the position (negative value indicates short
position, positive indicates long position).
type: number
format: double
averagePrice:
description: Volume-weighted average of the underlying Trade open prices
for the Position.
type: number
format: double
tradeIDs:
description: List of the open Trade IDs which contribute to the open Position.
type: array
items:
description: The Trade's identifier, unique within the Trade's Account.
type: integer
pl:
description: Profit/loss realized by the PositionSide over the lifetime
of the Account.
type: number
format: double
unrealizedPL:
description: The unrealized profit/loss of all open Trades that contribute
to this PositionSide.
type: number
format: double
resettablePL:
description: Profit/loss realized by the PositionSide since the Account's
resettablePL was last reset by the client.
type: number
format: double
financing:
description: The total amount of financing paid/collected for this PositionSide
over the lifetime of the Account.
type: number
format: double
guaranteedExecutionFees:
description: The total amount of fees charged over the lifetime of the Account
for the execution of guaranteed Stop Loss Orders attached to Trades for
this PositionSide.
type: number
format: double
ClosePositionRequest:
type: object
properties:
longUnits:
$ref: '#/components/schemas/NonableUnits'
longClientExtensions:
$ref: '#/components/schemas/ClientExtensions'
shortUnits:
$ref: '#/components/schemas/NonableUnits'
shortClientExtensions:
$ref: '#/components/schemas/ClientExtensions'
ClosePositionBadRequestResponse:
allOf:
- type: object
properties:
longOrderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
shortOrderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
ClosePositionNotFoundResponse:
allOf:
- type: object
properties:
longOrderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
shortOrderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
ClosePositionResponse:
allOf:
- type: object
properties:
longOrderCreateTransaction:
$ref: '#/components/schemas/MarketOrderTransaction'
longOrderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
longOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
shortOrderCreateTransaction:
$ref: '#/components/schemas/MarketOrderTransaction'
shortOrderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
shortOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
InstrumentPositionResponse:
type: object
properties:
position:
$ref: '#/components/schemas/Position'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
OpenPositionsResponse:
type: object
properties:
positions:
description: The list of open Positions in the Account.
type: array
items:
$ref: '#/components/schemas/Position'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
PositionsResponse:
type: object
properties:
positions:
description: The list of Account Positions.
type: array
items:
$ref: '#/components/schemas/Position'
lastTransactionID:
description: he ID of the most recent Transaction created for the Account
type: integer
ClientPrice:
description: The specification of an Account-specific Price.
type: object
properties:
type:
description: The string "PRICE". Used to identify the a Price object when
found in a stream.
type: string
instrument:
$ref: '#/components/schemas/InstrumentName'
time:
$ref: '#/components/schemas/DateTime'
status:
$ref: '#/components/schemas/PriceStatus'
tradeable:
description: Flag indicating if the Price is tradeable or not
type: boolean
bids:
description: The list of prices and liquidity available on the Instrument's
bid side. It is possible for this list to be empty if there is no bid
liquidity currently available for the Instrument in the Account.
type: array
items:
$ref: '#/components/schemas/PriceBucket'
asks:
description: The list of prices and liquidity available on the Instrument's
ask side. It is possible for this list to be empty if there is no ask
liquidity currently available for the Instrument in the Account.
type: array
items:
$ref: '#/components/schemas/PriceBucket'
closeoutBid:
description: The closeout bid Price. This Price is used when a bid is required
to closeout a Position (margin closeout or manual) yet there is no bid
liquidity. The closeout bid is never used to open a new position.
type: number
format: double
closeoutAsk:
description: The closeout ask Price. This Price is used when a ask is required
to closeout a Position (margin closeout or manual) yet there is no ask
liquidity. The closeout ask is never used to open a new position.
type: number
format: double
quoteHomeConversionFactors:
$ref: '#/components/schemas/QuoteHomeConversionFactors'
unitsAvailable:
$ref: '#/components/schemas/UnitsAvailable'
HomeConversions:
description: HomeConversions represents the factors to use to convert quantities
of a given currency into the Account's home currency. The conversion factor
depends on the scenario the conversion is required for.
type: object
properties:
currency:
type: string
description: The currency to be converted into the home currency. A string
containing an ISO 4217 currency (http://en.wikipedia.org/wiki/ISO_4217)
accountGain:
description: The factor used to convert any gains for an Account in the
specified currency into the Account's home currency. This would include
positive realized P/L and positive financing amounts. Conversion is performed
by multiplying the positive P/L by the conversion factor.
type: number
format: double
accountLoss:
description: The string representation of a decimal number.
type: number
format: double
positionValue:
description: The factor used to convert a Position or Trade Value in the
specified currency into the Account's home currency. Conversion is performed
by multiplying the Position or Trade Value by the conversion factor.
type: number
format: double
PriceBucket:
description: A Price Bucket represents a price available for an amount of liquidity
type: object
properties:
price:
description: The Price offered by the PriceBucket
type: number
format: double
liquidity:
description: The amount of liquidity offered by the PriceBucket
type: integer
PriceStatus:
description: Status of the price in terms of tradability
type: string
enum:
- tradeable
- non-tradeable
- invalid
x-enum-varnames:
- Tradeable
- NonTradeable
- Invalid
QuoteHomeConversionFactors:
description: QuoteHomeConversionFactors represents the factors that can be used
used to convert quantities of a Price's Instrument's quote currency into the
Account's home currency.
type: object
properties:
positiveUnits:
description: The factor used to convert a positive amount of the Price's
Instrument's quote currency into a positive amount of the Account's home
currency. Conversion is performed by multiplying the quote units by the
conversion factor.
type: number
format: double
negativeUnits:
description: The factor used to convert a negative amount of the Price's
Instrument's quote currency into a negative amount of the Account's home
currency. Conversion is performed by multiplying the quote units by the
conversion factor.
type: number
format: double
UnitsAvailable:
description: Representation of how many units of an Instrument are available
to be traded by an Order depending on its postionFill option.
type: object
properties:
default:
$ref: '#/components/schemas/UnitsAvailableDetails'
reduceFirst:
$ref: '#/components/schemas/UnitsAvailableDetails'
reduceOnly:
$ref: '#/components/schemas/UnitsAvailableDetails'
openOnly:
$ref: '#/components/schemas/UnitsAvailableDetails'
UnitsAvailableDetails:
description: Representation of many units of an Instrument are available to
be traded for both long and short Orders.
type: object
properties:
long:
description: The units available for long Orders.
type: number
format: double
short:
description: The units available for short Orders.
type: number
format: double
PricingResponse:
type: object
properties:
prices:
description: The list of Price objects requested.
type: array
items:
$ref: '#/components/schemas/ClientPrice'
homeConversions:
description: The list of home currency conversion factors requested. This
field will only be present if includeHomeConversions was set to true in
the request.
type: array
items:
$ref: '#/components/schemas/HomeConversions'
time:
$ref: '#/components/schemas/DateTime'
CalculatedTradeState:
description: The dynamic (calculated) state of an open Trade
type: object
properties:
id:
description: The Trade's ID.
type: integer
unrealizedPL:
description: The Trade's unrealized profit/loss.
type: number
format: double
marginUsed:
description: Margin currently used by the Trade.
type: number
format: double
Trade:
description: The specification of a Trade within an Account. This includes the
full representation of the Trade's dependent Orders in addition to the IDs
of those Orders.
type: object
properties:
id:
description: The Trade's identifier, unique within the Trade's Account.
type: integer
instrument:
$ref: '#/components/schemas/InstrumentName'
price:
description: The execution price of the Trade.
type: number
format: double
openTime:
$ref: '#/components/schemas/DateTime'
state:
$ref: '#/components/schemas/TradeState'
initialUnits:
description: The initial size of the Trade. Negative values indicate a short
Trade, and positive values indicate a long Trade.
type: number
format: double
initialMarginRequired:
description: The margin required at the time the Trade was created. Note,
this is the 'pure' margin required, it is not the 'effective' margin used
that factors in the trade risk if a GSLO is attached to the trade.
type: number
format: double
currentUnits:
description: The number of units currently open for the Trade. This value
is reduced to 0.0 as the Trade is closed.
type: number
format: double
realizedPL:
description: The total profit/loss realized on the closed portion of the
Trade.
type: number
format: double
unrealizedPL:
description: The unrealized profit/loss on the open portion of the Trade.
type: number
format: double
marginUsed:
description: Margin currently used by the Trade.
type: number
format: double
averageClosePrice:
description: The average closing price of the Trade. Only present if the
Trade has been closed or reduced at least once.
type: number
format: double
closingTransactionIDs:
description: The IDs of the Transactions that have closed portions of this
Trade.
type: array
items:
type: integer
description: The unique Transaction identifier within each Account.
financing:
description: The financing paid/collected for this Trade.
type: number
format: double
closeTime:
$ref: '#/components/schemas/DateTime'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
takeProfitOrder:
$ref: '#/components/schemas/TakeProfitOrder'
stopLossOrder:
$ref: '#/components/schemas/StopLossOrder'
trailingStopLossOrder:
$ref: '#/components/schemas/TrailingStopLossOrder'
TradeOpen:
description: A TradeOpen object represents a Trade for an instrument that was
opened in an Account. It is found embedded in Transactions that affect the
position of an instrument in the Account, specifically the OrderFill Transaction.
type: object
properties:
tradeID:
description: The ID of the Trade that was opened
type: integer
units:
type: number
format: double
description: The number of units opened by the Trade
price:
description: The average price that the units were opened at.
type: number
format: double
guaranteedExecutionFee:
description: This is the fee charged for opening the trade if it has a guaranteed
Stop Loss Order attached to it.
type: number
format: double
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
halfSpreadCost:
description: The half spread cost for the trade open. This can be a positive
or negative value and is represented in the home currency of the Account.
type: number
format: double
initialMarginRequired:
description: The margin required at the time the Trade was created. Note,
this is the 'pure' margin required, it is not the 'effective' margin used
that factors in the trade risk if a GSLO is attached to the trade.
type: number
format: double
TradeReduce:
description: A TradeReduce object represents a Trade for an instrument that
was reduced (either partially or fully) in an Account. It is found embedded
in Transactions that affect the position of an instrument in the account,
specifically the OrderFill Transaction.
type: object
properties:
tradeID:
description: The ID of the Trade that was reduced or closed
type: integer
units:
description: The number of units that the Trade was reduced by
type: number
format: double
price:
description: The average price that the units were closed at. This price
may be clamped for guaranteed Stop Loss Orders.
type: number
format: double
realizedPL:
description: The PL realized when reducing the Trade
type: number
format: double
financing:
description: The financing paid/collected when reducing the Trade
type: number
format: double
guaranteedExecutionFee:
description: This is the fee that is charged for closing the Trade if it
has a guaranteed Stop Loss Order attached to it.
type: number
format: double
halfSpreadCost:
description: The half spread cost for the trade reduce/close. This can be
apositive or negative value and is represented in the home currency of
the Account.
type: number
format: double
TradeState:
description: The current state of the Trade.
type: string
enum:
- OPEN
- CLOSED
- CLOSE_WHEN_TRADEABLE
x-enum-varnames:
- Open
- Closed
- CloseWhenTradeable
TradeSummary:
description: The summary of a Trade within an Account. This representation does
not provide the full details of the Trade's dependent Orders.
type: object
properties:
id:
description: The Trade's identifier, unique within the Trade's Account.
type: integer
instrument:
$ref: '#/components/schemas/InstrumentName'
price:
description: The execution price of the Trade.
type: number
format: double
openTime:
$ref: '#/components/schemas/DateTime'
state:
$ref: '#/components/schemas/TradeState'
initialUnits:
description: The initial size of the Trade. Negative values indicate a short
Trade, and positive values indicate a long Trade.
type: number
format: double
initialMarginRequired:
description: The margin required at the time the Trade was created. Note,
this is the 'pure' margin required, it is not the 'effective' margin used
that factors in the trade risk if a GSLO is attached to the trade.
type: number
format: double
currentUnits:
description: The number of units currently open for the Trade. This value
is reduced to 0.0 as the Trade is closed.
type: number
format: double
realizedPL:
description: The total profit/loss realized on the closed portion of the
Trade.
type: number
format: double
unrealizedPL:
description: The unrealized profit/loss on the open portion of the Trade.
type: number
format: double
marginUsed:
description: Margin currently used by the Trade.
type: number
format: double
averageClosePrice:
description: The average closing price of the Trade. Only present if the
Trade has been closed or reduced at least once.
type: number
format: double
closingTransactionIDs:
description: The IDs of the Transactions that have closed portions of this
Trade.
type: array
items:
type: integer
description: The unique Transaction identifier within each Account.
financing:
description: The financing paid/collected for this Trade.
type: number
format: double
closeTime:
$ref: '#/components/schemas/DateTime'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
takeProfitOrderID:
description: ID of the Trade's Take Profit Order, only provided if such
an Order exists.
type: integer
stopLossOrderID:
description: ID of the Trade's Stop Loss Order, only provided if such an
Order exists.
type: integer
trailingStopLossOrderID:
description: ID of the Trade's Trailing Stop Loss Order, only provided if
such an Order exists.
type: integer
CloseTradeRequest:
type: object
properties:
units:
$ref: '#/components/schemas/Units'
DependentTradeOrdersRequest:
type: object
properties:
takeProfit:
$ref: '#/components/schemas/TakeProfitDetails'
stopLoss:
$ref: '#/components/schemas/StopLossDetails'
trailingStopLoss:
$ref: '#/components/schemas/TrailingStopLossDetails'
TradeExtensionsRequest:
type: object
properties:
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
CloseTradeBadRequestResponse:
allOf:
- type: object
properties:
orderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
CloseTradeNotFoundResponse:
allOf:
- type: object
properties:
orderRejectTransaction:
$ref: '#/components/schemas/MarketOrderRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
CloseTradeResponse:
allOf:
- type: object
properties:
orderCreateTransaction:
$ref: '#/components/schemas/MarketOrderTransaction'
orderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
orderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
DependentTradeOrdersBadRequestResponse:
allOf:
- type: object
properties:
takeProfitOrderCancelRejectTransaction:
$ref: '#/components/schemas/OrderCancelRejectTransaction'
takeProfitOrderRejectTransaction:
$ref: '#/components/schemas/TakeProfitOrderRejectTransaction'
stopLossOrderCancelRejectTransaction:
$ref: '#/components/schemas/OrderCancelRejectTransaction'
stopLossOrderRejectTransaction:
$ref: '#/components/schemas/StopLossOrderRejectTransaction'
trailingStopLossOrderCancelRejectTransaction:
$ref: '#/components/schemas/OrderCancelRejectTransaction'
trailingStopLossOrderRejectTransaction:
$ref: '#/components/schemas/TrailingStopLossOrderRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
DependentTradeOrdersResponse:
allOf:
- type: object
properties:
takeProfitOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
takeProfitOrderTransaction:
$ref: '#/components/schemas/TakeProfitOrderTransaction'
takeProfitOrderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
takeProfitOrderCreatedCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
stopLossOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
stopLossOrderTransaction:
$ref: '#/components/schemas/StopLossOrderTransaction'
stopLossOrderFillTransaction:
$ref: '#/components/schemas/OrderFillTransaction'
stopLossOrderCreatedCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
trailingStopLossOrderCancelTransaction:
$ref: '#/components/schemas/OrderCancelTransaction'
trailingStopLossOrderTransaction:
$ref: '#/components/schemas/TrailingStopLossOrderTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
OpenTradeResponse:
type: object
properties:
trades:
description: The Account's list of open Trades
type: array
items:
$ref: '#/components/schemas/Trade'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
TradeExtensionsBadRequestResponse:
allOf:
- type: object
properties:
tradeClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/TradeClientExtensionsModifyRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
TradeExtensionsNotFoundResponse:
allOf:
- type: object
properties:
tradeClientExtensionsModifyRejectTransaction:
$ref: '#/components/schemas/TradeClientExtensionsModifyRejectTransaction'
- $ref: '#/components/schemas/Error4xxTransaction'
TradeExtensionsResponse:
allOf:
- type: object
properties:
tradeClientExtensionsModifyTransaction:
$ref: '#/components/schemas/TradeClientExtensionsModifyTransaction'
- $ref: '#/components/schemas/RelatedTransaction'
TradeResponse:
type: object
properties:
trade:
$ref: '#/components/schemas/Trade'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
TradesResponse:
type: object
properties:
trades:
description: The list of Trade detail objects
type: array
items:
$ref: '#/components/schemas/Trade'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
ClientConfigure:
description: A ClientConfigure represents the configuration of an Account by
a client.
type: object
properties:
alias:
description: The client-provided alias for the Account.
type: string
marginRate:
description: The margin rate override for the Account.
type: number
format: double
ClientConfigureRejectTransaction:
description: A ClientConfigureRejectTransaction represents the reject of configuration
of an Account by a client.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/ClientConfigure'
ClientConfigureTransaction:
description: A ClientConfigureTransaction represents the configuration of an
Account by a client.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/ClientConfigure'
OrderCancel:
description: An OrderCancel represents an Order cancellation in the client's
Account.
type: object
properties:
orderID:
description: The ID of the Order cancelled
type: integer
clientOrderID:
description: The client ID of the Order cancelled (only provided if the
Order has a client Order ID).
type: string
OrderCancelReason:
description: The reason that the Order was cancelled.
type: string
enum:
- INTERNAL_SERVER_ERROR
- ACCOUNT_LOCKED
- ACCOUNT_NEW_POSITIONS_LOCKED
- ACCOUNT_ORDER_CREATION_LOCKED
- ACCOUNT_ORDER_FILL_LOCKED
- CLIENT_REQUEST
- MIGRATION
- MARKET_HALTED
- LINKED_TRADE_CLOSED
- TIME_IN_FORCE_EXPIRED
- INSUFFICIENT_MARGIN
- FIFO_VIOLATION
- BOUNDS_VIOLATION
- CLIENT_REQUEST_REPLACED
- INSUFFICIENT_LIQUIDITY
- TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST
- TAKE_PROFIT_ON_FILL_LOSS
- LOSING_TAKE_PROFIT
- STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST
- STOP_LOSS_ON_FILL_LOSS
- STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED
- STOP_LOSS_ON_FILL_REQUIRED
- STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED
- STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED
- STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET
- STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED
- STOP_LOSS_ON_FILL_GUARANTEED_HEDGING_NOT_ALLOWED
- STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID
- STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID
- TAKE_PROFIT_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED
- TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST
- CLIENT_TRADE_ID_ALREADY_EXISTS
- POSITION_CLOSEOUT_FAILED
- OPEN_TRADES_ALLOWED_EXCEEDED
- PENDING_ORDERS_ALLOWED_EXCEEDED
- TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS
- STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS
- TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_ALREADY_EXISTS
- POSITION_SIZE_EXCEEDED
- HEDGING_GSLO_VIOLATION
- ACCOUNT_POSITION_VALUE_LIMIT_EXCEEDED
- INSTRUMENT_BID_REDUCE_ONLY
- INSTRUMENT_ASK_REDUCE_ONLY
- INSTRUMENT_BID_HALTED
- INSTRUMENT_ASK_HALTED
- STOP_LOSS_ON_FILL_GUARANTEED_BID_HALTED
- STOP_LOSS_ON_FILL_GUARANTEED_ASK_HALTED
x-enum-varnames:
- InternalServerError
- AccountLocked
- AccountNewPositionsLocked
- AccountOrderCreationLocked
- AccountOrderFillLocked
- ClientRequest
- Migration
- MarketHalted
- LinkedTradeClosed
- TimeInForceExpired
- InsufficientMargin
- FifoViolation
- BoundsViolation
- ClientRequestReplaced
- InsufficientLiquidity
- TakeProfitOnFillGtdTimestampInPast
- TakeProfitOnFillLoss
- LosingTakeProfit
- StopLossOnFillGtdTimestampInPast
- StopLossOnFillLoss
- StopLossOnFillPriceDistanceMaximumExceeded
- StopLossOnFillRequired
- StopLossOnFillGuaranteedRequired
- StopLossOnFillGuaranteedNotAllowed
- StopLossOnFillGuaranteedMinimumDistanceNotMet
- StopLossOnFillGuaranteedLevelRestrictionExceeded
- StopLossOnFillGuaranteedHedgingNotAllowed
- StopLossOnFillTimeInForceInvalid
- StopLossOnFillTriggerConditionInvalid
- TakeProfitOnFillPriceDistanceMaximumExceeded
- TrailingStopLossOnFillGtdTimestampInPast
- ClientTradeIdAlreadyExists
- PositionCloseoutFailed
- OpenTradesAllowedExceeded
- PendingOrdersAllowedExceeded
- TakeProfitOnFillClientOrderIdAlreadyExists
- StopLossOnFillClientOrderIdAlreadyExists
- TrailingStopLossOnFillClientOrderIdAlreadyExists
- PositionSizeExceeded
- HedgingGsloViolation
- AccountPositionValueLimitExceeded
- InstrumentBidReduceOnly
- InstrumentAskReduceOnly
- InstrumentBidHalted
- InstrumentAskHalted
- StopLossOnFillGuaranteedBidHalted
- StopLossOnFillGuaranteedAskHalted
OrderCancelRejectTransaction:
description: An OrderCancelRejectTransaction represents the rejection of the
cancellation of an Order in the client's Account.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/OrderCancel'
OrderCancelTransaction:
description: An OrderCancelTransaction represents the cancellation of an Order
in the client's Account.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/OrderCancel'
- type: object
properties:
reason:
$ref: '#/components/schemas/OrderCancelReason'
replacedByOrderID:
description: The ID of the Order that replaced this Order (only provided
if this Order was cancelled for replacement).
type: integer
OrderClientExtensionsModify:
description: A OrderClientExtensionsModify represents the modification of an
Order's Client Extensions.
type: object
properties:
orderID:
description: The ID of the Order who's client extensions are to be modified.
type: integer
clientOrderID:
description: The original Client ID of the Order who's client extensions
are to be modified.
type: string
clientExtensionsModify:
$ref: '#/components/schemas/ClientExtensions'
tradeClientExtensionsModify:
$ref: '#/components/schemas/ClientExtensions'
OrderClientExtensionsModifyRejectTransaction:
description: A OrderClientExtensionsModifyRejectTransaction represents the rejection
of the modification of an Order's Client Extensions.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/OrderClientExtensionsModify'
OrderClientExtensionsModifyTransaction:
description: A OrderClientExtensionsModifyTransaction represents the modification
of an Order's Client Extensions.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/OrderClientExtensionsModify'
OrderFillReason:
description: The reason that an Order was filled
type: string
enum:
- LIMIT_ORDER
- STOP_ORDER
- MARKET_IF_TOUCHED_ORDER
- TAKE_PROFIT_ORDER
- STOP_LOSS_ORDER
- TRAILING_STOP_LOSS_ORDER
- MARKET_ORDER
- MARKET_ORDER_TRADE_CLOSE
- MARKET_ORDER_POSITION_CLOSEOUT
- MARKET_ORDER_MARGIN_CLOSEOUT
- MARKET_ORDER_DELAYED_TRADE_CLOSE
x-enum-varnames:
- LimitOrder
- StopOrder
- MarketIfTouchedOrder
- TakeProfitOrder
- StopLossOrder
- TrailingStopLossOrder
- MarketOrder
- MarketOrderTradeClose
- MarketOrderPositionCloseout
- MarketOrderMarginCloseout
- MarketOrderDelayedTradeClose
OrderFillTransaction:
description: An OrderFillTransaction represents the filling of an Order in the
client's Account.
type: object
properties:
orderID:
description: The ID of the Order filled.
type: integer
clientOrderID:
description: The client Order ID of the Order filled (only provided if the
client has assigned one).
type: string
instrument:
$ref: '#/components/schemas/InstrumentName'
units:
description: The number of units filled by the OrderFill.
type: number
format: double
gainQuoteHomeConversionFactor:
description: This is the conversion factor in effect for the Account at
the time of the OrderFill for converting any gains realized in Instrument
quote units into units of the Account's home currency.
type: number
format: double
lossQuoteHomeConversionFactor:
description: This is the conversion factor in effect for the Account at
the time of the OrderFill for converting any losses realized in Instrument
quote units into units of the Account's home currency.
type: number
format: double
price:
description: This field is now deprecated and should no longer be used.
The individual tradesClosed, tradeReduced and tradeOpened fields contain
the exact/official price each unit was filled at.
type: number
format: double
deprecated: true
fullVWAP:
description: The price that all of the units of the OrderFill should have
been filled at, in the absence of guaranteed price execution. This factors
in the Account's current ClientPrice, used liquidity and the units of
the OrderFill only. If no Trades were closed with their price clamped
for guaranteed stop loss enforcement, then this value will match the price
fields of each Trade opened, closed, and reduced, and they will all be
the exact same.
type: number
format: double
fullPrice:
$ref: '#/components/schemas/ClientPrice'
reason:
$ref: '#/components/schemas/OrderFillReason'
pl:
description: The profit or loss incurred when the Order was filled.
type: number
format: double
financing:
description: The financing paid or collected when the Order was filled
type: number
format: double
commission:
description: The commission charged in the Account's home currency as a
result of filling the Order. The commission is always represented as a
positive quantity of the Account's home currency, however it reduces the
balance in the Account.
type: number
format: double
guaranteedExecutionFee:
description: The total guaranteed execution fees charged for all Trades
opened, closed or reduced with guaranteed Stop Loss Orders.
type: number
format: double
accountBalance:
description: The Account's balance after the Order was filled.
type: number
format: double
tradeOpened:
$ref: '#/components/schemas/TradeOpen'
tradesClosed:
description: The Trades that were closed when the Order was filled (only
provided if filling the Order resulted in a closing open Trades).
type: array
items:
$ref: '#/components/schemas/TradeReduce'
tradeReduced:
$ref: '#/components/schemas/TradeReduce'
halfSpreadCost:
description: The half spread cost for the OrderFill, which is the sum of
the halfSpreadCost values in the tradeOpened, tradesClosed and tradeReduced
fields. This can be a positive or negative value and is represented in
the home currency of the Account.
type: number
format: double
MarketOrder:
description: A MarketOrder represents the creation of a Market Order in the
user's account. A Market Order is an Order that is filled immediately at the
current market price.
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
units:
description: The quantity requested to be filled by the Market Order. A
posititive number of units results in a long Order, and a negative number
of units results in a short Order.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/MarketOrderTradeClose'
priceBound:
description: The worst price that the client is willing to have the Market
Order filled at.
type: number
format: double
positionFill:
$ref: '#/components/schemas/MarketOrderPositionFill'
tradeClose:
description: A MarketOrderTradeClose specifies the extensions to a Market
Order that has been created specifically to close a Trade.
type: object
properties:
tradeID:
description: The ID of the Trade requested to be closed
type: integer
clientTradeID:
description: The client ID of the Trade requested to be closed
type: string
units:
$ref: '#/components/schemas/Units'
longPositionCloseout:
$ref: '#/components/schemas/MarketOrderPositionCloseout'
shortPositionCloseout:
$ref: '#/components/schemas/MarketOrderPositionCloseout'
marginCloseout:
$ref: '#/components/schemas/MarketOrderMarginCloseout'
delayedTradeClose:
$ref: '#/components/schemas/MarketOrderDelayedTradeClose'
reason:
$ref: '#/components/schemas/MarketOrderReason'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
takeProfitOnFill:
$ref: '#/components/schemas/TakeProfitDetails'
stopLossOnFill:
$ref: '#/components/schemas/StopLossDetails'
trailingStopLossOnFill:
$ref: '#/components/schemas/TrailingStopLossDetails'
tradeClientExtensions:
$ref: '#/components/schemas/ClientExtensions'
MarketOrderDelayedTradeClose:
description: Details for the Market Order extensions specific to a Market Order
placed with the intent of fully closing a specific open trade that should
have already been closed but wasn't due to halted market conditions
type: object
properties:
tradeID:
type: integer
description: The ID of the Trade being closed
clientTradeID:
type: string
description: The Client ID of the Trade being closed
sourceTransactionID:
type: integer
description: The Transaction ID of the DelayedTradeClosure transaction to
which this Delayed Trade Close belongs to
MarketOrderMarginCloseout:
description: Details for the Market Order extensions specific to a Market Order
placed that is part of a Market Order Margin Closeout in a client's account
type: object
properties:
reason:
$ref: '#/components/schemas/MarketOrderMarginCloseoutReason'
MarketOrderMarginCloseoutReason:
description: The reason the Market Order was created to perform a margin closeout
type: string
enum:
- MARGIN_CHECK_VIOLATION
- REGULATORY_MARGIN_CALL_VIOLATION
- REGULATORY_MARGIN_CHECK_VIOLATION
x-enum-varnames:
- MarginCheckViolation
- RegulatoryMarginCallViolation
- RegulatoryMarginCheckViolation
MarketOrderPositionCloseout:
description: A MarketOrderPositionCloseout specifies the extensions to a Market
Order when it has been created to closeout a specific Position.
type: object
properties:
instrument:
$ref: '#/components/schemas/InstrumentName'
units:
$ref: '#/components/schemas/Units'
MarketOrderPositionFill:
description: Specification of how Positions in the Account are modified when
the Order is filled.
type: string
enum:
- OPEN_ONLY
- REDUCE_FIRST
- REDUCE_ONLY
- DEFAULT
x-enum-varnames:
- OpenOnly
- ReduceFirst
- ReduceOnly
- Default
MarketOrderReason:
description: The reason that the Market Order was created
type: string
enum:
- CLIENT_ORDER
- TRADE_CLOSE
- POSITION_CLOSEOUT
- MARGIN_CLOSEOUT
- DELAYED_TRADE_CLOSE
x-enum-varnames:
- ClientOrder
- TradeClose
- PositionCloseout
- MarginCloseout
- DelayedTradeClose
MarketOrderRejectTransaction:
description: A MarketOrderRejectTransaction represents the rejection of the
creation of a Market Order.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/MarketOrder'
MarketOrderTimeInForce:
$ref: '#/components/schemas/MarketOrderTradeClose'
MarketOrderTradeClose:
description: The time-in-force requested for the Market Order. Restricted to
FOK or IOC for a MarketOrder.
type: string
enum:
- FOK
- IOC
x-enum-varnames:
- Fok
- Ioc
MarketOrderTransaction:
description: A MarketOrderTransaction represents the creation of a Market Order
in the user's account. A Market Order is an Order that is filled immediately
at the current market price.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/MarketOrder'
StopLossOrderRejectTransaction:
description: A StopLossOrderRejectTransaction represents the rejection of the
creation of a StopLoss Order.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/StopLossOrderTransactionBase'
StopLossOrderTransaction:
description: A StopLossOrderTransaction represents the creation of a StopLoss
Order in the user's Account.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/StopLossOrderTransactionBase'
StopLossOrderTransactionBase:
description: A StopLossOrder represents the creation of a StopLoss Order in
the user's Account.
type: object
properties:
tradeID:
description: The ID of the Trade to close when the price threshold is breached.
type: integer
clientTradeID:
description: The client ID of the Trade to be closed when the price threshold
is breached.
type: string
price:
description: The price threshold specified for the Stop Loss Order. If the
guaranteed flag is false, the associated Trade will be closed by a market
price that is equal to or worse than this threshold. If the flag is true
the associated Trade will be closed at this price.
type: number
format: double
distance:
description: Specifies the distance (in price units) from the Account's
current price to use as the Stop Loss Order price. If the Trade is short
the Instrument's bid price is used, and for long Trades the ask is used.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
triggerCondition:
$ref: '#/components/schemas/TradeOrderTriggerCondition'
guaranteed:
description: Flag indicating that the Stop Loss Order is guaranteed. The
default value depends on the GuaranteedStopLossOrderMode of the account,
if it is REQUIRED, the default will be true, for DISABLED or ENABLED the
default is false.
type: boolean
guaranteedExecutionPremium:
description: The fee that will be charged if the Stop Loss Order is guaranteed
and the Order is filled at the guaranteed price. The value is determined
at Order creation time. It is in price units and is charged for each unit
of the Trade.
type: number
format: double
reason:
$ref: '#/components/schemas/TradeOrderTransactionReason'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
orderFillTransactionID:
description: The ID of the OrderFill Transaction that caused this Order
to be created (only provided if this Order was created automatically when
another Order was filled).
type: integer
replacesOrderID:
description: The ID of the Order that this Order replaces (only provided
if this Order replaces an existing Order).
type: integer
cancellingTransactionID:
description: The ID of the Transaction that cancels the replaced Order (only
provided if this Order replaces an existing Order).
type: integer
TakeProfitOrderRejectTransaction:
description: A TakeProfitOrderRejectTransaction represents the rejection of
the creation of a TakeProfit Order.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/TakeProfitOrderTransactionBase'
TakeProfitOrderTransaction:
description: A TakeProfitOrderTransaction represents the creation of a TakeProfit
Order in the user's Account.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/TakeProfitOrderTransactionBase'
TakeProfitOrderTransactionBase:
description: A TakeProfitOrder represents the creation of a TakeProfit Order.
type: object
properties:
tradeID:
description: The ID of the Trade to close when the price threshold is breached.
type: integer
clientTradeID:
description: The client ID of the Trade to be closed when the price threshold
is breached.
type: string
price:
description: The price threshold specified for the Stop Loss Order. If the
guaranteed flag is false, the associated Trade will be closed by a market
price that is equal to or worse than this threshold. If the flag is true
the associated Trade will be closed at this price.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
triggerCondition:
$ref: '#/components/schemas/TradeOrderTriggerCondition'
reason:
$ref: '#/components/schemas/TradeOrderTransactionReason'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
orderFillTransactionID:
description: The ID of the OrderFill Transaction that caused this Order
to be created (only provided if this Order was created automatically when
another Order was filled).
type: integer
replacesOrderID:
description: The ID of the Order that this Order replaces (only provided
if this Order replaces an existing Order).
type: integer
cancellingTransactionID:
description: The ID of the Transaction that cancels the replaced Order (only
provided if this Order replaces an existing Order).
type: integer
TradeOrderTransactionReason:
description: The reason that the Stop Loss Order was initiated
type: string
enum:
- CLIENT_ORDER
- REPLACEMENT
- ON_FILL
x-enum-varnames:
- ClientOrder
- Replacement
- OnFill
TrailingStopLossOrderRejectTransaction:
description: A TrailingStopLossOrderRejectTransaction represents the rejection
of the creation of a TrailingStopLoss Order.
type: object
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/TrailingStopLossOrderTransactionBase'
TrailingStopLossOrderTransaction:
description: A TrailingStopLossOrderTransaction represents the creation of a
TrailingStopLoss Order in the user's Account.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/TrailingStopLossOrderTransactionBase'
TrailingStopLossOrderTransactionBase:
description: A TrailingStopLossOrder represents the creation of a TrailingStopLoss
Order in the user's Account.
type: object
properties:
tradeID:
description: The ID of the Trade to close when the price threshold is breached.
type: integer
clientTradeID:
description: The client ID of the Trade to be closed when the price threshold
is breached.
type: string
distance:
description: Specifies the distance (in price units) from the Account's
current price to use as the Stop Loss Order price. If the Trade is short
the Instrument's bid price is used, and for long Trades the ask is used.
type: number
format: double
timeInForce:
$ref: '#/components/schemas/TradeOrderTimeInForce'
gtdTime:
$ref: '#/components/schemas/DateTime'
triggerCondition:
$ref: '#/components/schemas/TradeOrderTriggerCondition'
reason:
$ref: '#/components/schemas/TradeOrderTransactionReason'
clientExtensions:
$ref: '#/components/schemas/ClientExtensions'
orderFillTransactionID:
description: The ID of the OrderFill Transaction that caused this Order
to be created (only provided if this Order was created automatically when
another Order was filled).
type: integer
replacesOrderID:
description: The ID of the Order that this Order replaces (only provided
if this Order replaces an existing Order).
type: integer
cancellingTransactionID:
description: The ID of the Transaction that cancels the replaced Order (only
provided if this Order replaces an existing Order).
type: integer
RejectTransaction:
description: A RejectTransaction represents the abstract reject of any transaction
kind.
type: object
allOf:
- $ref: '#/components/schemas/Transaction'
- type: object
properties:
rejectReason:
description: The reason that the Reject Transaction was created
type: string
enum:
- INTERNAL_SERVER_ERROR
- INSTRUMENT_PRICE_UNKNOWN
- ACCOUNT_NOT_ACTIVE
- ACCOUNT_LOCKED
- ACCOUNT_ORDER_CREATION_LOCKED
- ACCOUNT_CONFIGURATION_LOCKED
- ACCOUNT_DEPOSIT_LOCKED
- ACCOUNT_WITHDRAWAL_LOCKED
- ACCOUNT_ORDER_CANCEL_LOCKED
- INSTRUMENT_NOT_TRADEABLE
- PENDING_ORDERS_ALLOWED_EXCEEDED
- ORDER_ID_UNSPECIFIED
- ORDER_DOESNT_EXIST
- ORDER_IDENTIFIER_INCONSISTENCY
- TRADE_ID_UNSPECIFIED
- TRADE_DOESNT_EXIST
- TRADE_IDENTIFIER_INCONSISTENCY
- INSUFFICIENT_MARGIN
- INSTRUMENT_MISSING
- INSTRUMENT_UNKNOWN
- UNITS_MISSING
- UNITS_INVALID
- UNITS_PRECISION_EXCEEDED
- UNITS_LIMIT_EXCEEDED
- UNITS_MIMIMUM_NOT_MET
- PRICE_MISSING
- PRICE_INVALID
- PRICE_PRECISION_EXCEEDED
- PRICE_DISTANCE_MISSING
- PRICE_DISTANCE_INVALID
- PRICE_DISTANCE_PRECISION_EXCEEDED
- PRICE_DISTANCE_MAXIMUM_EXCEEDED
- PRICE_DISTANCE_MINIMUM_NOT_MET
- TIME_IN_FORCE_MISSING
- TIME_IN_FORCE_INVALID
- TIME_IN_FORCE_GTD_TIMESTAMP_MISSING
- TIME_IN_FORCE_GTD_TIMESTAMP_IN_PAST
- PRICE_BOUND_INVALID
- PRICE_BOUND_PRECISION_EXCEEDED
- ORDERS_ON_FILL_DUPLICATE_CLIENT_ORDER_IDS
- TRADE_ON_FILL_CLIENT_EXTENSIONS_NOT_SUPPORTED
- CLIENT_ORDER_ID_INVALID
- CLIENT_ORDER_ID_ALREADY_EXISTS
- CLIENT_ORDER_TAG_INVALID
- CLIENT_ORDER_COMMENT_INVALID
- CLIENT_TRADE_ID_INVALID
- CLIENT_TRADE_ID_ALREADY_EXISTS
- CLIENT_TRADE_TAG_INVALID
- CLIENT_TRADE_COMMENT_INVALID
- ORDER_FILL_POSITION_ACTION_MISSING
- ORDER_FILL_POSITION_ACTION_INVALID
- TRIGGER_CONDITION_MISSING
- TRIGGER_CONDITION_INVALID
- ORDER_PARTIAL_FILL_OPTION_MISSING
- ORDER_PARTIAL_FILL_OPTION_INVALID
- INVALID_REISSUE_IMMEDIATE_PARTIAL_FILL
- TAKE_PROFIT_ORDER_ALREADY_EXISTS
- TAKE_PROFIT_ON_FILL_PRICE_MISSING
- TAKE_PROFIT_ON_FILL_PRICE_INVALID
- TAKE_PROFIT_ON_FILL_PRICE_PRECISION_EXCEEDED
- TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_MISSING
- TAKE_PROFIT_ON_FILL_TIME_IN_FORCE_INVALID
- TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_MISSING
- TAKE_PROFIT_ON_FILL_GTD_TIMESTAMP_IN_PAST
- TAKE_PROFIT_ON_FILL_CLIENT_ORDER_ID_INVALID
- TAKE_PROFIT_ON_FILL_CLIENT_ORDER_TAG_INVALID
- TAKE_PROFIT_ON_FILL_CLIENT_ORDER_COMMENT_INVALID
- TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_MISSING
- TAKE_PROFIT_ON_FILL_TRIGGER_CONDITION_INVALID
- STOP_LOSS_ORDER_ALREADY_EXISTS
- STOP_LOSS_ORDER_GUARANTEED_REQUIRED
- STOP_LOSS_ORDER_GUARANTEED_PRICE_WITHIN_SPREAD
- STOP_LOSS_ORDER_GUARANTEED_NOT_ALLOWED
- STOP_LOSS_ORDER_GUARANTEED_HALTED_CREATE_VIOLATION
- STOP_LOSS_ORDER_GUARANTEED_HALTED_TIGHTEN_VIOLATION
- STOP_LOSS_ORDER_GUARANTEED_HEDGING_NOT_ALLOWED
- STOP_LOSS_ORDER_GUARANTEED_MINIMUM_DISTANCE_NOT_MET
- STOP_LOSS_ORDER_NOT_CANCELABLE
- STOP_LOSS_ORDER_NOT_REPLACEABLE
- STOP_LOSS_ORDER_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED
- STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_SPECIFIED
- STOP_LOSS_ORDER_PRICE_AND_DISTANCE_BOTH_MISSING
- STOP_LOSS_ON_FILL_REQUIRED_FOR_PENDING_ORDER
- STOP_LOSS_ON_FILL_GUARANTEED_NOT_ALLOWED
- STOP_LOSS_ON_FILL_GUARANTEED_REQUIRED
- STOP_LOSS_ON_FILL_PRICE_MISSING
- STOP_LOSS_ON_FILL_PRICE_INVALID
- STOP_LOSS_ON_FILL_PRICE_PRECISION_EXCEEDED
- STOP_LOSS_ON_FILL_GUARANTEED_MINIMUM_DISTANCE_NOT_MET
- STOP_LOSS_ON_FILL_GUARANTEED_LEVEL_RESTRICTION_EXCEEDED
- STOP_LOSS_ON_FILL_DISTANCE_INVALID
- STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED
- STOP_LOSS_ON_FILL_DISTANCE_PRECISION_EXCEEDED
- STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_SPECIFIED
- STOP_LOSS_ON_FILL_PRICE_AND_DISTANCE_BOTH_MISSING
- STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING
- STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID
- STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING
- STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST
- STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID
- STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID
- STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID
- STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING
- STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID
- TRAILING_STOP_LOSS_ORDER_ALREADY_EXISTS
- TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MISSING
- TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_INVALID
- TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_PRECISION_EXCEEDED
- TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MAXIMUM_EXCEEDED
- TRAILING_STOP_LOSS_ON_FILL_PRICE_DISTANCE_MINIMUM_NOT_MET
- TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_MISSING
- TRAILING_STOP_LOSS_ON_FILL_TIME_IN_FORCE_INVALID
- TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_MISSING
- TRAILING_STOP_LOSS_ON_FILL_GTD_TIMESTAMP_IN_PAST
- TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_ID_INVALID
- TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_TAG_INVALID
- TRAILING_STOP_LOSS_ON_FILL_CLIENT_ORDER_COMMENT_INVALID
- TRAILING_STOP_LOSS_ORDERS_NOT_SUPPORTED
- TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_MISSING
- TRAILING_STOP_LOSS_ON_FILL_TRIGGER_CONDITION_INVALID
- CLOSE_TRADE_TYPE_MISSING
- CLOSE_TRADE_PARTIAL_UNITS_MISSING
- CLOSE_TRADE_UNITS_EXCEED_TRADE_SIZE
- CLOSEOUT_POSITION_DOESNT_EXIST
- CLOSEOUT_POSITION_INCOMPLETE_SPECIFICATION
- CLOSEOUT_POSITION_UNITS_EXCEED_POSITION_SIZE
- CLOSEOUT_POSITION_REJECT
- CLOSEOUT_POSITION_PARTIAL_UNITS_MISSING
- MARKUP_GROUP_ID_INVALID
- POSITION_AGGREGATION_MODE_INVALID
- ADMIN_CONFIGURE_DATA_MISSING
- MARGIN_RATE_INVALID
- MARGIN_RATE_WOULD_TRIGGER_CLOSEOUT
- ALIAS_INVALID
- CLIENT_CONFIGURE_DATA_MISSING
- MARGIN_RATE_WOULD_TRIGGER_MARGIN_CALL
- AMOUNT_INVALID
- INSUFFICIENT_FUNDS
- AMOUNT_MISSING
- FUNDING_REASON_MISSING
- CLIENT_EXTENSIONS_DATA_MISSING
- REPLACING_ORDER_INVALID
- REPLACING_TRADE_ID_INVALID
x-enum-varnames:
- InternalServerError
- InstrumentPriceUnknown
- AccountNotActive
- AccountLocked
- AccountOrderCreationLocked
- AccountConfigurationLocked
- AccountDepositLocked
- AccountWithdrawalLocked
- AccountOrderCancelLocked
- InstrumentNotTradeable
- PendingOrdersAllowedExceeded
- OrderIdUnspecified
- OrderDoesntExist
- OrderIdentifierInconsistency
- TradeIdUnspecified
- TradeDoesntExist
- TradeIdentifierInconsistency
- InsufficientMargin
- InstrumentMissing
- InstrumentUnknown
- UnitsMissing
- UnitsInvalid
- UnitsPrecisionExceeded
- UnitsLimitExceeded
- UnitsMimimumNotMet
- PriceMissing
- PriceInvalid
- PricePrecisionExceeded
- PriceDistanceMissing
- PriceDistanceInvalid
- PriceDistancePrecisionExceeded
- PriceDistanceMaximumExceeded
- PriceDistanceMinimumNotMet
- TimeInForceMissing
- TimeInForceInvalid
- TimeInForceGtdTimestampMissing
- TimeInForceGtdTimestampInPast
- PriceBoundInvalid
- PriceBoundPrecisionExceeded
- OrdersOnFillDuplicateClientOrderIds
- TradeOnFillClientExtensionsNotSupported
- ClientOrderIdInvalid
- ClientOrderIdAlreadyExists
- ClientOrderTagInvalid
- ClientOrderCommentInvalid
- ClientTradeIdInvalid
- ClientTradeIdAlreadyExists
- ClientTradeTagInvalid
- ClientTradeCommentInvalid
- OrderFillPositionActionMissing
- OrderFillPositionActionInvalid
- TriggerConditionMissing
- TriggerConditionInvalid
- OrderPartialFillOptionMissing
- OrderPartialFillOptionInvalid
- InvalidReissueImmediatePartialFill
- TakeProfitOrderAlreadyExists
- TakeProfitOnFillPriceMissing
- TakeProfitOnFillPriceInvalid
- TakeProfitOnFillPricePrecisionExceeded
- TakeProfitOnFillTimeInForceMissing
- TakeProfitOnFillTimeInForceInvalid
- TakeProfitOnFillGtdTimestampMissing
- TakeProfitOnFillGtdTimestampInPast
- TakeProfitOnFillClientOrderIdInvalid
- TakeProfitOnFillClientOrderTagInvalid
- TakeProfitOnFillClientOrderCommentInvalid
- TakeProfitOnFillTriggerConditionMissing
- TakeProfitOnFillTriggerConditionInvalid
- StopLossOrderAlreadyExists
- StopLossOrderGuaranteedRequired
- StopLossOrderGuaranteedPriceWithinSpread
- StopLossOrderGuaranteedNotAllowed
- StopLossOrderGuaranteedHaltedCreateViolation
- StopLossOrderGuaranteedHaltedTightenViolation
- StopLossOrderGuaranteedHedgingNotAllowed
- StopLossOrderGuaranteedMinimumDistanceNotMet
- StopLossOrderNotCancelable
- StopLossOrderNotReplaceable
- StopLossOrderGuaranteedLevelRestrictionExceeded
- StopLossOrderPriceAndDistanceBothSpecified
- StopLossOrderPriceAndDistanceBothMissing
- StopLossOnFillRequiredForPendingOrder
- StopLossOnFillGuaranteedNotAllowed
- StopLossOnFillGuaranteedRequired
- StopLossOnFillPriceMissing
- StopLossOnFillPriceInvalid
- StopLossOnFillPricePrecisionExceeded
- StopLossOnFillGuaranteedMinimumDistanceNotMet
- StopLossOnFillGuaranteedLevelRestrictionExceeded
- StopLossOnFillDistanceInvalid
- StopLossOnFillPriceDistanceMaximumExceeded
- StopLossOnFillDistancePrecisionExceeded
- StopLossOnFillPriceAndDistanceBothSpecified
- StopLossOnFillPriceAndDistanceBothMissing
- StopLossOnFillTimeInForceMissing
- StopLossOnFillTimeInForceInvalid
- StopLossOnFillGtdTimestampMissing
- StopLossOnFillGtdTimestampInPast
- StopLossOnFillClientOrderIdInvalid
- StopLossOnFillClientOrderTagInvalid
- StopLossOnFillClientOrderCommentInvalid
- StopLossOnFillTriggerConditionMissing
- StopLossOnFillTriggerConditionInvalid
- TrailingStopLossOrderAlreadyExists
- TrailingStopLossOnFillPriceDistanceMissing
- TrailingStopLossOnFillPriceDistanceInvalid
- TrailingStopLossOnFillPriceDistancePrecisionExceeded
- TrailingStopLossOnFillPriceDistanceMaximumExceeded
- TrailingStopLossOnFillPriceDistanceMinimumNotMet
- TrailingStopLossOnFillTimeInForceMissing
- TrailingStopLossOnFillTimeInForceInvalid
- TrailingStopLossOnFillGtdTimestampMissing
- TrailingStopLossOnFillGtdTimestampInPast
- TrailingStopLossOnFillClientOrderIdInvalid
- TrailingStopLossOnFillClientOrderTagInvalid
- TrailingStopLossOnFillClientOrderCommentInvalid
- TrailingStopLossOrdersNotSupported
- TrailingStopLossOnFillTriggerConditionMissing
- TrailingStopLossOnFillTriggerConditionInvalid
- CloseTradeTypeMissing
- CloseTradePartialUnitsMissing
- CloseTradeUnitsExceedTradeSize
- CloseoutPositionDoesntExist
- CloseoutPositionIncompleteSpecification
- CloseoutPositionUnitsExceedPositionSize
- CloseoutPositionReject
- CloseoutPositionPartialUnitsMissing
- MarkupGroupIdInvalid
- PositionAggregationModeInvalid
- AdminConfigureDataMissing
- MarginRateInvalid
- MarginRateWouldTriggerCloseout
- AliasInvalid
- ClientConfigureDataMissing
- MarginRateWouldTriggerMarginCall
- AmountInvalid
- InsufficientFunds
- AmountMissing
- FundingReasonMissing
- ClientExtensionsDataMissing
- ReplacingOrderInvalid
- ReplacingTradeIdInvalid
RelatedTransaction:
description: The definition of related transactions and the last transaction
encapsulated in an object.
type: object
properties:
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
relatedTransactionIDs:
description: The IDs of all Transactions that were created while satisfying
the request.
type: array
items:
type: integer
description: The unique Transaction identifier within each Account.
nullable: true
Transaction:
description: The base Transaction specification. Specifies properties that are
common between all Transaction.
type: object
properties:
id:
description: The Transaction's Identifier.
type: integer
time:
$ref: '#/components/schemas/DateTime'
userID:
description: The ID of the user that initiated the creation of the Transaction.
type: integer
accountID:
$ref: '#/components/schemas/AccountId'
batchID:
description: The ID of the "batch" that the Transaction belongs to. Transactions
in the same batch are applied to the Account simultaneously.
type: integer
requestID:
description: The Request ID of the request which generated the transaction.
type: string
type:
$ref: '#/components/schemas/TransactionType'
TransactionHeartbeat:
description: A TransactionHeartbeat object is injected into the Transaction
stream to ensure that the HTTP connection remains active.
type: object
properties:
type:
type: string
description: The string "HEARTBEAT"
enum:
- HEARTBEAT
x-enum-varnames:
- Heartbeat
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
time:
$ref: '#/components/schemas/DateTime'
TransactionRejectReason:
$ref: '#/components/schemas/TransactionHeartbeat'
TransactionType:
description: The Type of the Transaction.
type: string
enum:
- CREATE
- CLOSE
- REOPEN
- CLIENT_CONFIGURE
- CLIENT_CONFIGURE_REJECT
- TRANSFER_FUNDS
- TRANSFER_FUNDS_REJECT
- MARKET_ORDER
- MARKET_ORDER_REJECT
- FIXED_PRICE_ORDER
- LIMIT_ORDER
- LIMIT_ORDER_REJECT
- STOP_ORDER
- STOP_ORDER_REJECT
- MARKET_IF_TOUCHED_ORDER
- MARKET_IF_TOUCHED_ORDER_REJECT
- TAKE_PROFIT_ORDER
- TAKE_PROFIT_ORDER_REJECT
- STOP_LOSS_ORDER
- STOP_LOSS_ORDER_REJECT
- TRAILING_STOP_LOSS_ORDER
- TRAILING_STOP_LOSS_ORDER_REJECT
- ORDER_FILL
- ORDER_CANCEL
- ORDER_CANCEL_REJECT
- ORDER_CLIENT_EXTENSIONS_MODIFY
- ORDER_CLIENT_EXTENSIONS_MODIFY_REJECT
- TRADE_CLIENT_EXTENSIONS_MODIFY
- TRADE_CLIENT_EXTENSIONS_MODIFY_REJECT
- MARGIN_CALL_ENTER
- MARGIN_CALL_EXTEND
- MARGIN_CALL_EXIT
- DELAYED_TRADE_CLOSURE
- DAILY_FINANCING
- RESET_RESETTABLE_PL
x-enum-varnames:
- Create
- Close
- Reopen
- ClientConfigure
- ClientConfigureReject
- TransferFunds
- TransferFundsReject
- MarketOrder
- MarketOrderReject
- FixedPriceOrder
- LimitOrder
- LimitOrderReject
- StopOrder
- StopOrderReject
- MarketIfTouchedOrder
- MarketIfTouchedOrderReject
- TakeProfitOrder
- TakeProfitOrderReject
- StopLossOrder
- StopLossOrderReject
- TrailingStopLossOrder
- TrailingStopLossOrderReject
- OrderFill
- OrderCancel
- OrderCancelReject
- OrderClientExtensionsModify
- OrderClientExtensionsModifyReject
- TradeClientExtensionsModify
- TradeClientExtensionsModifyReject
- MarginCallEnter
- MarginCallExtend
- MarginCallExit
- DelayedTradeClosure
- DailyFinancing
- ResetResettablePl
TradeClientExtensionsModify:
type: object
description: A TradeClientExtensionsModifyTransaction represents the modification
of a Trade's Client Extensions.
properties:
tradeID:
type: integer
description: The ID of the Trade who's client extensions are to be modified.
clientTradeID:
type: string
description: The original Client ID of the Trade who's client extensions
are to be modified.
tradeClientExtensionsModify:
$ref: '#/components/schemas/ClientExtensions'
TradeClientExtensionsModifyRejectTransaction:
type: object
description: A TradeClientExtensionsModifyRejectTransaction represents the rejection
of the modification of a Trade's Client Extensions.
allOf:
- $ref: '#/components/schemas/RejectTransaction'
- $ref: '#/components/schemas/TradeClientExtensionsModify'
TradeClientExtensionsModifyTransaction:
type: object
description: A TradeClientExtensionsModifyTransaction represents the modification
of a Trade's Client Extensions.
allOf:
- $ref: '#/components/schemas/Transaction'
- $ref: '#/components/schemas/TradeClientExtensionsModify'
TransactionIdRangeResponse:
type: object
properties:
transactions:
description: The list of Transactions that satisfy the request.
type: array
items:
$ref: '#/components/schemas/Transaction'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
TransactionResponse:
type: object
properties:
transaction:
$ref: '#/components/schemas/Transaction'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
TransactionSinceIdResponse:
type: object
properties:
transactions:
description: The list of Transactions that satisfy the request.
type: array
items:
$ref: '#/components/schemas/Transaction'
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
TransactionsResponse:
type: object
properties:
from:
$ref: '#/components/schemas/DateTime'
to:
$ref: '#/components/schemas/DateTime'
pageSize:
description: The pageSize provided in the request
type: integer
type:
description: The Transaction-type filter provided in the request
type: array
items:
$ref: '#/components/schemas/TransactionType'
count:
description: The number of Transactions that are contained in the pages
returned
type: integer
pages:
description: The list of URLs that represent idrange queries providing the
data for each page in the query results
type: array
items:
type: string
lastTransactionID:
description: The ID of the most recent Transaction created for the Account
type: integer
ClientExtensions:
description: A ClientExtensions object allows a client to attach a clientID,
tag and comment to Orders and Trades in their Account. Do not set, modify,
or delete this field if your account is associated with MT4.
type: object
properties:
id:
description: The Client ID of the Order/Trade
type: string
tag:
description: A tag associated with the Order/Trade
type: string
comment:
description: A comment associated with the Order/Trade
type: string
DateTime:
description: A date and time value using either RFC3339 or UNIX time representation.
The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt.
The Unix representation is a string representing the number of seconds since
the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number,
where the fractional part represents a fraction of a second (up to nine decimal
places).
type: string
pattern: ^(?:(?:\d+(?:\.\d{1,9})?)|(?:[1-9]\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,9})?(?:Z|[+-][01]\d:[0-5]\d))$
DateTimeFormat:
description: Types of accepted and handled datetime formats
type: string
enum:
- UNIX
- RFC3339
x-enum-varnames:
- Unix
- RfC3339
IdSpecifier:
description: An ID which is either the system assigned integer or a client defined
string starting with a @
type: string
pattern: ^(?:(?:\d+)|(?:\@\w+))$
NonableUnits:
description: Either "ALL", "NONE", or a DecimalNumber reflection a partial unit
type: string
pattern: ^(?:(?:ALL)|(?:NONE)|(?:\d+(?:\.\d+)?))$
Units:
description: Either "ALL", or a positive DecimalNumber reflection a partial
unit
type: string
pattern: ^(?:(?:ALL)|(?:\d+(?:\.\d+)?))$
Error4xxBody:
description: Error response body
type: object
properties:
errorCode:
type: string
description: The code of the error that has occurred. This field may not
be returned for some errors.
errorMessage:
type: string
description: The human-readable description of the error that has occurred.
Error4xxTransaction:
allOf:
- $ref: '#/components/schemas/Error4xxBody'
- $ref: '#/components/schemas/RelatedTransaction'
Error400:
description: Client error 400, bad request.
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
Error401:
description: Client error 401, unauthorized.
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
Error403:
description: Client error 403, forbidden
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
Error404:
description: Client error 404, not found
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
Error405:
description: Client error 405, method not allowed
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
Error416:
description: Client error 416, range not satisfiable
type: object
allOf:
- $ref: '#/components/schemas/Error4xxBody'
parameters:
AcceptDatetimeFormat:
name: Accept-Datetime-Format
description: Format of DateTime fields in the request and response.
in: header
required: false
schema:
$ref: '#/components/schemas/DateTimeFormat'
AccountId:
name: accountId
description: Account identifier
in: path
required: true
schema:
$ref: '#/components/schemas/AccountId'
ClientRequestId:
name: ClientRequestId
description: Client specified RequestID to be sent with request.
in: header
schema:
type: string
InstrumentName:
name: instrument
description: Instrument name
in: path
required: true
schema:
$ref: '#/components/schemas/InstrumentName'
OrderSpecifier:
name: orderSpecifier
description: The Order Specifier
in: path
required: true
schema:
$ref: '#/components/schemas/IdSpecifier'
TradeSpecifier:
name: tradeSpecifier
description: Specifier for the Trade
in: path
required: true
schema:
$ref: '#/components/schemas/IdSpecifier'
TransactionId:
name: transactionId
description: A Transaction identifier
required: true
in: path
schema:
type: integer
headers:
ContentEncoding:
description: Value will be "gzip" regardless of provided Accept-Encoding header
schema:
type: string
Link:
description: A link to the next/previous page.
schema:
type: string
Location:
description: A link to the newly created entity
schema:
type: string
RequestId:
description: The unique identifier generated for the request
schema:
type: string