Skip to content

Read history orders by position#

About#

Returns the history of completed orders for a specific position id

GET /users/current/accounts/:accountId/history-orders/position/:positionId

For more information see Swagger documentation. Note, that this URL is valid for new-york region only. You can find URLs for other regions on API access page.

Headers#

Name Type Required Description
auth-token string Yes authorization token. See Authentication & authorization

Path parameters#

Name Type Required Description
accountId string Yes MetaTrader account id. You can retrieve account id from Web application after you add your MetaTrader account to our platform. The account id can also be obtained via Provisioning API
positionId string Yes position id

Responses:

  • 200 - History orders with requested position id for a specified MetaTrader account returned successfully. Response schema: Array<MetatraderOrder>
  • 401 - Authorization failed. Response schema: Error
  • 404 - MetaTrader account not found or not provisioned yet. Response schema: Error

Examples#

Example request:

curl -X GET --header 'Accept: application/json' --header 'auth-token: token' 'https://mt-client-api-v1.new-york.agiliumtrade.ai/users/current/accounts/865d3a4d-3803-486d-bdf3-a85679d9fad2/history-orders/position/46648037'

Example response:

[
  {
    "clientId": "AS_AUDNZD_3zfxXl3RvJ",
    "currentPrice": 1.05782,
    "currentVolume": 0,
    "doneTime": "2020-04-17T04:30:03.223Z",
    "doneBrokerTime": "2020-04-17 07:30:03.223",
    "id": "46648037",
    "magic": 1000,
    "platform": "mt5",
    "positionId": "46648037",
    "state": "ORDER_STATE_FILLED",
    "symbol": "AUDNZD",
    "time": "2020-04-17T04:30:02.966Z",
    "brokerTime": "2020-04-17 07:30:02.966",
    "type": "ORDER_TYPE_BUY",
    "volume": 0.12
  }
]