API v1 (stable) · MT5 · 9 operations ·
base URL https://cloud.mywebapi.com ·
OpenAPI v1 (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.
GET /api/MT5/{tradePlatform}/DealRequest/{login}/{fromTime}/{toTime}
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
login
path
integer (int64)
yes
fromTime
path
string (date-time)
no
Default: 0.ToUnixTime64() (01.01.1970) will be used
toTime
path
string (date-time)
no
Default: UInt64.MaxValue.ToUnixTime64() will be used
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/MT5/{tradePlatform}/DealRequestByGroup/{mask}/{fromTime}/{toTime}
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
mask
path
string
yes
The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using * (any value) and ! (exception). For example: demo*,!demoforex - all groups with the names beginning with 'demo', except for the group demoforex.
fromTime
path
string (date-time)
no
Default: 0.ToUnixTime64() (01.01.1970) will be used
toTime
path
string (date-time)
no
Default: UInt64.MaxValue.ToUnixTime64() will be used
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/MT5/{tradePlatform}/DealRequestByGroupSymbol/{mask}/{symbol}/{fromTime}/{toTime}
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
mask
path
string
yes
The groups for which deals are requested. You can specify one group, several groups (comma separated) or a group mask. The mask is specified using * (any value) and ! (exception). For example: demo*,!demoforex - all groups with the names beginning with 'demo', except for the group demoforex.
symbol
path
string
yes
The symbol for which you need to get deals. You can specify multiple symbols separated by commas.
fromTime
path
string (date-time)
no
Default: 0.ToUnixTime64() (01.01.1970) will be used
toTime
path
string (date-time)
no
Default: UInt64.MaxValue.ToUnixTime64() will be used
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.
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
tickets
query
integer (int64)[]
no
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.
POST /api/MT5/{tradePlatform}/DealRequestByTickets
Similar to the GET version, but using request body, you can send a much longer list of ticket
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
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/MT5/{tradePlatform}/DealRequestByLogins/{fromTime}/{toTime}
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
logins
query
integer (int64)[]
no
fromTime
path
string (date-time)
no
Default: 0.ToUnixTime64() (01.01.1970) will be used
toTime
path
string (date-time)
no
Default: UInt64.MaxValue.ToUnixTime64() will be used
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/MT5/{tradePlatform}/DealRequestByTicket/{ticket}
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 id
ticket
path
integer (int64)
yes
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.
It will request deal from MT5 and apply only received parameters. So, you can send only the ones you'd like to update and leave everything else as null.
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 id
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.
A deal can only be deleted from the applications connected to the trade server, on which the deals have been created. For all other applications, the response code MT_RET_ERR_NOTMAIN is returned. If the object is not found, the response code MT_RET_ERR_NOTFOUND is returned.
Please note that deletion of deals does not affect the client's balance and current positions. Therefore, IMTAdmin::PositionCheck and IMTManagerAPI::UserBalanbceCheckwill show that the client's positions and balance do not match the relevant deals history.
Bulk deletion is executed faster than deletion of the same number of deals in a cycle one by one, using IMTManagerAPI::DealDelete.The acceleration can be especially noticeable when deleting deals belonging to one account.
To improve performance, it is recommended to create arrays and perform group operations separately for each trading account.
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
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.
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.