Skip to content

Get Open Trades

Returns a paginated trade table for the authenticated account.

GET

https://{some_domain}/trades

Authorization

All requests must include a JWT token:

Authorization: <JWT_TOKEN>

The account login is resolved from the authenticated session.

Request

Content-Type: application/json

Body Parameters

Field Type Required Description
limit int Yes Maximum number of rows to return
offset int Yes Pagination offset
tradeType int Yes Trade type filter
where array No Additional filter rules
whereNot array No Negated filter rules
whereIn array No Inclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereNotIn array No Exclusion filter rules in [[field, [value1, value2, ...]], ...] format
whereBetween array No Range filter rules in [[field, [from, to]], ...] format
whereNotBetween array No Negative range filter rules in [[field, [from, to]], ...] format

net_profit can be used in where, whereNot, whereIn, whereNotIn, and range filters as a calculated field. It is calculated as profit + commission + storage.

tradeType Values

  • 0 = all trades
  • 1 = open trades
  • 2 = closed trades
  • 3 = pending trades
  • 4 = finance trades

For this method the usual client flow is tradeType = 1.

Response

Success (200)

{
  "structure": [
    "order", "login", "cmd", "state", "symbol", "reason", "volume", "open_time", "close_time",
    "open_price", "close_price", "sl", "tp", "profit", "net_profit", "commission", "storage", "comment",
    "digits", "expiration"
  ],
  "rows": [
    [1001234, 1001, 0, 1, "EURUSD", 2, 100, 1713500000, 0, 1.1010, 0, 1.0900, 1.1200, 0.0, -1.6, -1.2, -0.4, "", 5, 0]
  ],
  "count": 1,
  "total_profit": 0.0,
  "total_net_profit": -1.6,
  "total_storage": -0.4,
  "total_commission": -1.2,
  "total_volume": 100
}

Error Responses

Code Error Description
400 INVALID_DATA Validation failed
400 INVALID_USER Authenticated account is not available
401 PERMISSION_DENIED Missing or invalid authenticated session