Skip to content

Read deals by position#

About#

Returns history deals for a specific position id

GET /users/current/accounts/:accountId/history-deals/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 deals with requested position id for a specified MetaTrader account returned successfully. Response schema: Array<MetatraderDeal>
  • 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-deals/position/46648037'

Example response:

[
  {
    "clientId": "AS_AUDNZD_3zfxXl3RvJ",
    "commission": -0.42,
    "entryType": "DEAL_ENTRY_IN",
    "id": "33582357",
    "magic": 1000,
    "platform": "mt5",
    "orderId": "46648037",
    "positionId": "46648037",
    "price": 1.05782,
    "profit": 0,
    "swap": 0,
    "symbol": "AUDNZD",
    "time": "2020-04-17T04:30:03.223Z",
    "brokerTime": "2020-04-17 07:30:03.223",
    "type": "DEAL_TYPE_BUY",
    "volume": 0.12
  }
]