Skip to content

Get History By Login

GetTradesHistoryByLogin

Description:
Returns the list of closed trades for a specified account (login) within a given time range.
The response is returned in structure + rows format for efficient table rendering.


Access Control

🛡️ Access Level Required: SESSION_USER, SESSION_MANAGER, SESSION_ADMIN, SESSION_DEALER


Endpoint

GET /trades/history/login/


Request Parameters

Name Type Required Description
login int Yes Account login ID
from int Yes Start timestamp (Unix time)
to int Yes End timestamp (Unix time)

Request Example

{
  "login": 123456,
  "from": 1700000000,
  "to": 1710000000
}

Response Format

The response contains:

  • structure: array of column names
  • rows: array of trade rows (arrays aligned with structure)

Structure Fields

Field Description
order Trade order ID
login Account login
cmd Trade command (BUY/SELL/etc.)
state Trade state
symbol Trading symbol
reason Reason code
volume Volume in minimal lots
open_time Open timestamp
close_time Close timestamp
open_price Open price
close_price Close price
sl Stop Loss
tp Take Profit
profit Profit/Loss
commission Commission
storage Swap/Storage
comment Trade comment
digits Price precision digits
expiration Expiration timestamp

Example Response

{
  "structure": [
    "order","login","cmd","state","symbol","reason","volume","open_time","close_time",
    "open_price","close_price","sl","tp","profit","commission","storage","comment",
    "digits","expiration"
  ],
  "rows": [
    [1001234,123456,0,2,"EURUSD",2,1000,1701000000,1701003600,1.1010,1.1050,1.0900,1.1200,400.0,-2.5,-1.2,"closed trade",5,0]
  ]
}

Error Responses

Validation Error

{
  "error": "INVALID_DATA",
  "message": "login is required"
}

Retrieval Error

{
  "error": "TRADE_HISTORY_ERROR",
  "message": "Unable to fetch trade history"
}