API v2 (current) · MT5 · 41 operations ·
base URL https://cloud.mywebapi.com ·
OpenAPI v2 (JSON) ·
Redoc
Every call needs Authorization: Bearer $TOKEN — an OAuth 2.0 client-credentials token from
https://auth.cplugin.net/connect/token (scope webapi).
$TRADE_PLATFORM_ID is the id of a trade platform registered in Toolbox.
Creates an order in the trade database of the connected server. The ticket, when given,
must fall inside the order ticket range of the server and be above the last used ticket;
when it is omitted the server assigns the next free one. The order is stored as passed:
the server checks the fields, it does not trade them.
The operation is not idempotent — a repeat after an unclear outcome may add a second order
with another ticket.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order (application/json) — Order fields. Fields omitted keep the defaults the server assigns to a new order.
Adds every order of the body and answers one result code per order, at the same index as
in the request. A partial failure answers the array as well, so the caller sees which
orders were stored; a complete failure answers the error code only. An empty body is
rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome may add the orders a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order[] (application/json) — Order fields, one entry per order to add.
POST /api/v2/MT5/{tradePlatform}/OrderAddBatchArray
Same effect and same reply as the batch form: one result code per order of the body, at
the same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome may add the orders a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order[] (application/json) — Order fields, one entry per order to add.
Applies only the fields present in the body to the stored order; everything omitted keeps
its current value. The order must exist and must have been created on the server this
request is addressed to — any other server answers with an error instead of applying the
change.
The operation is not idempotent — a repeat after an unclear outcome applies the change a
second time and may overwrite a newer value.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order (application/json) — Order fields to apply; the ticket identifies the order.
Applies the fields present in each entry to its stored order and answers one result code
per entry, at the same index as in the request. Every order must carry its ticket and must
belong to the server this request is addressed to. An empty body is rejected as invalid
input.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order[] (application/json) — Order fields to apply, one entry per order.
POST /api/v2/MT5/{tradePlatform}/OrderUpdateBatchArray
Same effect and same reply as the batch form: one result code per entry of the body, at
the same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Order[] (application/json) — Order fields to apply, one entry per order.
POST /api/v2/MT5/{tradePlatform}/OrderCancel/{ticket}
Moves the order to the cancelled state: it is neither executed nor triggered and no margin
is held for it. The order must have been created on the server this request is addressed
to; any other server answers with an error.
The operation is not idempotent — a repeat after an unclear outcome is refused with the
state error of the trade server, not applied twice.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Order ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/OrderCancel/$TICKET" \
-H "Authorization: Bearer $TOKEN"
Cancel several orders
POST /api/v2/MT5/{tradePlatform}/OrderCancelBatch
Cancels every ticket of the body and answers one result code per ticket, at the same index
as in the request. A partial failure answers the array as well; a complete failure answers
the error code only. An empty body is rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome is refused for the
tickets already cancelled.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
integer (int64)[] (application/json) — Order tickets to cancel.
POST /api/v2/MT5/{tradePlatform}/OrderDelete/{ticket}
Removes the order record from the trade database; it is not moved to history. The order
must have been created on the server this request is addressed to.
The operation is not idempotent — a repeat after an unclear outcome answers "not found".
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Order ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/OrderDelete/$TICKET" \
-H "Authorization: Bearer $TOKEN"
Open orders of an account
GET /api/v2/MT5/{tradePlatform}/OrderGetOpen/{login}
Returns the pending orders of the account that are still in the trade database, read from
the server rather than from the local cache. The result is not paginated: the whole set is
returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/OrderRequest/{ticket}
Returns a single order read from the trade server, bypassing the local cache of the
connection. When the ticket is unknown, the response carries the trade server's "not
found" error code instead of a record.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Order ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/OrderRequestByLogins
Returns the orders of the given accounts as the trade server holds them now. The result is
not paginated: the whole set is returned at once. Use the ticket-based form for a longer
list than fits in the query string.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Orders of several accounts by symbol, read from the server
GET /api/v2/MT5/{tradePlatform}/OrderRequestByLoginsSymbol/{symbol}
Returns the orders of the given symbol for the given accounts as the trade server holds
them now. The result is not paginated: the whole set is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
symbol
path
string
yes
Symbol name.
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Pending orders of an account, read from the server
GET /api/v2/MT5/{tradePlatform}/OrderRequestOpen/{login}
Same set as the cached read, but the trade server is asked each time, so the answer is
current even when the cache of the connection is behind. The result is not paginated: the
whole set is returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/HistoryRequestByGroupSymbol/{mask}/{symbol}
Returns the history orders of the given symbol for every login in the groups matching the
mask, within a time window. Omitted bounds mean the whole history: from 01.01.1970 to the
newest record. The result is not paginated: the whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
symbol
path
string
yes
Symbol name.
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/HistoryRequestByLogins
Returns the history orders of the given accounts within a time window. Omitted bounds mean
the whole history: from 01.01.1970 to the newest record. The result is not paginated: the
whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/HistoryRequestByLoginsSymbol/{symbol}
Returns the history orders of the given symbol for the given accounts within a time
window. Omitted bounds mean the whole history: from 01.01.1970 to the newest record. The
result is not paginated: the whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
symbol
path
string
yes
Symbol name.
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/HistoryRequestPage/{login}
Returns a slice of the history orders of the account, read from the server. The window and
the slice are given in the query; an omitted window means the whole history. The page may
be shorter than total at the end of the range — walk it by adding the returned count
to offset.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
offset
query
integer (int32)
no
Index of the first record of the page.
total
query
integer (int32)
no
Maximum number of records in the page.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Reads the stored position by its ticket and applies only the fields present in the body,
so everything omitted keeps its current value. A position is identified by its ticket; the
record must live on the server this request is addressed to.
The operation is not idempotent — a repeat after an unclear outcome applies the change a
second time and may overwrite a newer value.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Position (application/json) — Position fields to apply; position.Position identifies the position.
POST /api/v2/MT5/{tradePlatform}/PositionUpdateBatch
Reads every stored position by its ticket, applies the fields present in each entry and
answers one result code per entry, at the same index as in the request. Every entry must
carry its ticket; an unknown ticket aborts the whole batch before anything is written and
its error code is answered instead. An empty body is rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Position[] (application/json) — Position fields to apply, one entry per position.
POST /api/v2/MT5/{tradePlatform}/PositionUpdateBatchArray
Same effect and same reply as the batch form: one result code per entry of the body, at
the same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Position[] (application/json) — Position fields to apply, one entry per position.
Converts the volumes and prices of the listed positions by the ratio of the request (a
corporate action, for example) and answers one result code per ticket, at the same index
as in the request. Omit adjustments to let the server calculate the balance
adjustments itself; pass an array of zeros to skip them. A partial failure answers the
array as well.
The operation is not idempotent — a repeat after an unclear outcome splits the positions a
second time by the same ratio.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
POST /api/v2/MT5/{tradePlatform}/PositionDeleteByTicket/{ticket}
Removes the position record from the trade database without producing a closing deal, so
the account balance is not changed and may no longer add up. The position must live on the
server this request is addressed to.
The operation is not idempotent — a repeat after an unclear outcome answers "not found".
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Position ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/PositionDeleteByTicket/$TICKET" \
-H "Authorization: Bearer $TOKEN"
Open positions of a group
GET /api/v2/MT5/{tradePlatform}/PositionGetByGroup/{mask}
Returns the open positions of every login in the groups matching the mask. The result is
not paginated: the whole set is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/PositionGetByTicket/{ticket}
Returns a single open position by its ticket. Under the hedged accounting mode this is the
only way to address a position, because one account may hold several positions in the same
symbol.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Position ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Open positions of an account, read from the server
GET /api/v2/MT5/{tradePlatform}/PositionRequest/{login}
Same set as the cached read, but the trade server is asked each time, so the answer is
current even when the cache of the connection is behind. The result is not paginated: the
whole set is returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Open positions of a group and symbol, read from the server
GET /api/v2/MT5/{tradePlatform}/PositionRequestByGroupSymbol/{mask}/{symbol}
Returns the open positions of the given symbol for the logins in the groups matching the
mask, read from the trade server. The result is not paginated: the whole set is returned
at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
mask
path
string
yes
Group mask — one group, several comma-separated groups, or a mask with * (any value) and ! (exception), for example demo*,!demoforex.
symbol
path
string
yes
Symbol name.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Open positions of several accounts, read from the server
GET /api/v2/MT5/{tradePlatform}/PositionRequestByLogins
Returns the open positions of the given accounts as the trade server holds them now. The
result is not paginated: the whole set is returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Open positions of several accounts by symbol, read from the server
GET /api/v2/MT5/{tradePlatform}/PositionRequestByLoginsSymbol/{symbol}
Returns the open positions of the given symbol for the given accounts as the trade server
holds them now. The result is not paginated: the whole set is returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
symbol
path
string
yes
Symbol name.
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
POST /api/v2/MT5/{tradePlatform}/PositionRequestByTickets
Returns the open positions with the given tickets, sent in the request body so a long list
fits. The result is not paginated: the whole set is returned at once.
Timeout: 10 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 10 s (read). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
integer (int64)[] (application/json) — Position tickets, in request-body JSON array form.
Stores a deal in the trade database of the connected server without trading it: the
balance of the account is not changed by the call itself, the record is simply written.
The ticket, when given, must fall inside the deal ticket range of the server and be above
the last used one; when omitted the server assigns the next free ticket.
The operation is not idempotent — a repeat after an unclear outcome may add a second deal.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Adds every deal of the body and answers one result code per deal, at the same index as in
the request. A partial failure answers the array as well; a complete failure answers the
error code only. An empty body is rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome may add the deals a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deal fields, one entry per deal to add.
POST /api/v2/MT5/{tradePlatform}/DealAddBatchArray
Same effect and same reply as the batch form: one result code per deal of the body, at the
same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome may add the deals a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deal fields, one entry per deal to add.
Executes a trade on the account: the balance and the positions change as the trade
requires, which is what separates this call from storing a deal record. Login, symbol,
action, volume and price are mandatory; the closing of a position under the hedged
accounting mode also needs its identifier. The account must belong to the server this
request is addressed to. The reply is the deal as the server stored it, with the ticket and
time it assigned.
The operation is not idempotent — a repeat after an unclear outcome performs the trade a
second time and moves the balance twice.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Performs every deal of the body and answers one result code per deal, at the same index as
in the request. A partial failure answers the array as well; a complete failure answers the
error code only. An empty body is rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome performs the trades a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deals to perform, one entry per deal.
POST /api/v2/MT5/{tradePlatform}/DealPerformBatchArray
Same effect and same reply as the batch form: one result code per deal of the body, at the
same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome performs the trades a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deals to perform, one entry per deal.
Applies the fields present in each entry to its stored deal and answers one result code per
entry, at the same index as in the request. Every entry must carry its ticket. An empty
body is rejected as invalid input.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deal fields to apply, one entry per deal.
POST /api/v2/MT5/{tradePlatform}/DealUpdateBatchArray
Same effect and same reply as the batch form: one result code per entry of the body, at
the same index. Kept because the two forms are separate operations of the trade server and
differ in the shape of the array they accept.
The operation is not idempotent — a repeat after an unclear outcome applies the changes a
second time.
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Request body
MT5Deal[] (application/json) — Deal fields to apply, one entry per deal.
POST /api/v2/MT5/{tradePlatform}/DealDelete/{ticket}
Removes the deal record from the trade database. The balance and the open positions are
not recalculated, so the account may afterwards fail consistency checks. The deal must live
on the server this request is addressed to.
The operation is not idempotent — a repeat after an unclear outcome answers "not found".
Timeout: 5 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: The operation may still be completed by the server (X-Request-Outcome: unknown): check its result before repeating it.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
ticket
path
integer (int64)
yes
Deal ticket.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 5 s (trade operation). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
curl -X POST "https://cloud.mywebapi.com/api/v2/MT5/$TRADE_PLATFORM_ID/DealDelete/$TICKET" \
-H "Authorization: Bearer $TOKEN"
Deals of several accounts by symbol
GET /api/v2/MT5/{tradePlatform}/DealRequestByLoginsSymbol/{symbol}
Returns the deals of the given symbol for the given accounts within a time window, read
from the trade server. Omitted bounds mean the whole history. The result is not paginated:
the whole window is returned at once.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
symbol
path
string
yes
Symbol name.
logins
query
integer (int64)[]
no
Account logins, repeated as logins=…&logins=… query parameters.
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
GET /api/v2/MT5/{tradePlatform}/DealRequestPage/{login}
Returns a slice of the deals of the account, read from the server. The window and the slice
are given in the query; an omitted window means the whole history. The page may be shorter
than total at the end of the range — walk it by adding the returned count to
offset.
Timeout: 30 s by default, adjustable per request with the X-Request-Timeout header. When the trade server does not answer in time: Nothing was changed; the request is safe to repeat.
Parameters
Name
In
Type
Required
Description
tradePlatform
path
string (uuid)
yes
Trade platform identifier (GUID).
login
path
integer (int64)
yes
Account login (account number).
from
query
string (date-time)
no
Window start; omit to start from 01.01.1970.
to
query
string (date-time)
no
Window end; omit to take everything up to the newest record.
offset
query
integer (int32)
no
Index of the first record of the page.
total
query
integer (int32)
no
Maximum number of records in the page.
X-Request-Timeout
header
number (double)
no
How long to wait for the trade server, in seconds (1–300). Default for this operation: 30 s (history or report). The query parameter requestTimeout does the same for clients that cannot set headers. The applied value is returned in the X-Request-Timeout-Applied response header.
Read-only: the trade server does not let this value be changed.
timeSetupMsc
string (date-time), nullable
Gets and sets the order placing time in milliseconds, since 1970.01.01 If the value of this field is specified, the TimeSetup value will be filled in automatically.
timeDoneMsc
string (date-time), nullable
Gets and sets the order execution time in milliseconds, since 1970.01.01 If the value of this field is specified, the TimeDone value will be filled in automatically.
rateMargin
number (double), nullable
margin conversion rate (from symbol margin currency to deposit currency)
positionByID
integer (int64), nullable
position by id
modificationFlags
integer (int32), nullable
modification flags
volumeInitialExt
integer (int64), nullable
order initial volume with extended accuracy
volumeCurrentExt
integer (int64), nullable
order current volume with extended accuracy
BooleanApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5ResultListApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5OrderListApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5OrderApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5Position
Property
Type
Description
login
integer (int64), nullable
Gets the login of the client, to whom the trade position belongs
Request body of the position split: the positions to convert, the conversion ratio and the rounding rules applied to the recalculated prices and volumes.
Property
Type
Description
tickets
integer (int64)[]
Tickets of the positions to split or consolidate. Every ticket must belong to the trade server the request is addressed to.
adjustments
number (double)[]
Balance adjustments, one per ticket and in the same order. Omit the whole array to let the server calculate the adjustments; send an array of zeros when no adjustment is needed.
newShares
integer (int32)
Number of shares after the conversion (the numerator of the ratio).
oldShares
integer (int32)
Number of shares before the conversion (the denominator of the ratio).
roundRulePrice
integer (int32)
Price rounding rule when the recalculated price has more digits than the symbol allows.
roundRuleVolume
integer (int32)
Volume rounding rule when the conversion leaves a fractional number of shares.
flags
integer (int32)
Additional split options.
MT5PositionListApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5PositionApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5Deal
Property
Type
Description
deal *
integer (int64)
deal ticket
externalID
string, nullable
deal ticket in external system (exchange, ECN, etc)
Read-only: the trade server does not let this value be changed. modification flags
MT5DealApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
MT5DealListApiResponse
Unified v2 response envelope: data is the payload (null on error); error is the error object (null on success, always serialised); meta contains response metadata (activityId and optional paging). HTTP status is always 200.
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
Flags: names of the set bits joined by ", " ("NoLimit, NoStop"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: NoLimit = 0x1, NoStop = 0x2, NoSLimit = 0x4, NoSL = 0x8, NoTP = 0x10, NoSO = 0x20, NoExpiration = 0x40. Accepted on input, never written: All = NoLimit, NoStop, NoSLimit, NoSL, NoTP, NoSO, NoExpiration.
ApiError
v2 error body. Code is the stable transport error code; ManagerCode is the raw MT4 ResultCode (serialized as a string for a known enum member, or as a number for an unrecognised value returned by MT4); Message is a human-readable description.
Property
Type
Description
code
WebApiErrorCode
Stable transport-level error code.
managerCode
ResultCode
Raw MT4/MT5 manager result code, when the error came from the trading platform; otherwise null.
message
string, nullable
Human-readable error description.
ApiMeta
Response metadata. ActivityId identifies the request — quote it when you contact support. Paging is present only on paginated list responses; otherwise it is omitted.
Property
Type
Description
activityId
string, nullable
W3C trace id of the request. Quote it when you contact support: it finds this exact call in the server logs.
paging
PagingMeta
Pagination info; present only on list responses, omitted otherwise.
also used for Deal,Order,Position Flags: names of the set bits joined by ", " ("Admin, Manager"), "None" when none is set; a set bit without a name is "Bit<n>" (bit number). Bits: Admin = 0x1, Manager = 0x2, Position = 0x4, Restore = 0x8, ApiAdmin = 0x10, ApiManager = 0x20, ApiServer = 0x40, ApiGateway = 0x80. Accepted on input, never written: All = Admin, Manager, Position, Restore, ApiAdmin, ApiManager, ApiServer, ApiGateway.