Export Trades By Login
ExportTradesByLogin¶
Description: Exports the full filtered trade list for the authenticated account into a file stored in the server storage directory.
The account login is resolved from the authenticated session. The method does not return trade rows in JSON.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
tradeType |
int | Yes | Trade type filter in range 0..4 |
format |
string | Yes | Output format: csv or excel |
where |
array | No | Additional conditions for filtering trades |
whereNot |
array | No | Exclusion conditions for filtering trades |
orderBy |
array | No | Sort instructions |
select |
array | No | List of fields to export. If omitted or empty, all default trade fields are exported |
Trade Types¶
0= all trades1= open trades2= closed trades3= pending trades4= finance trades
Supported select Fields¶
If select is passed, every item must be one of the fields below. Any unknown field causes 400 INVALID_DATA.
orderlogincmdstatesymbolreasonvolumeopen_timeclose_timeopen_priceclose_pricesltpprofitcommissionstoragecommentdigitsexpiration
Request Example¶
{
"tradeType": 1,
"format": "excel",
"select": ["order", "symbol", "open_time", "profit"],
"where": [],
"whereNot": [],
"orderBy": [["open_time", "DESC"]]
}
Response Parameters¶
| Name | Type | Description |
|---|---|---|
file_name |
string | Generated file name stored in storage/ |
Successful Response Example¶
{
"file_name": "550e8400-e29b-41d4-a716-446655440000.xls"
}
Notes¶
format = "csv"generates a.csvfileformat = "excel"currently generates an Excel-compatible.xlsfile- the response contains only the generated file name with extension
- the export always contains the full filtered result set
limitandoffsetare not supported by this method
Errors¶
| Code | Description |
|---|---|
| 400 | Invalid request payload or unsupported field in select |
| 400 | Authenticated account is not available |
| 500 | Export directory creation or file write failed |