RequestAccountHistory
Request for trading history for an account
Request format
{
"Login": 10001,
"TradeCommands":["Buy","BuyCanceled"]
"From": "2016-10-06",
"To": "2017-01-14",
"PageSize": 100,
"PageNum": 1,
"RequestId": "c5bc135c-a4eb-45a9-9f98-822c1ba0830b",
"Nodes": [
"node1"
],
"RequestName": "RequestAccountHistory"
}
Deal type
public enum TradeCommand
{
Buy = 0,
Sell,
BuyLimit,
SellLimit,
BuyStop,
SellStop,
Balance,
Credit,
BuyCanceled,
SellCanceled,
Correction,
Bonus,
Commission,
Dividend,
Tax,
InterestRate,
Charge,
Specific,
BuyStopLimit,
SellStopLimit,
}
Request parameters:
| Name | Description |
|---|---|
| RequestId | Unique request GUID |
| Nodes | One node is indicated on which the account is registered |
| Login | Login by which the history is needed |
| TradeCommands | Deal type filter |
| From | History start date and time |
| To | Date and time of the end of history |
| RequestName | Request type |
| PageSize | Number of records per page |
| PageNum | Page number (first page - 1) |
Respoinse ResponseAccountHistory
{
"Result": [
{
"Node": "Node1",
"Platform": "Mt4",
"Result": {
"Page": [
{
"Node": "Node1",
"Platform": "Mt4",
"Order": 430201,
"Login": 100001,
"Group": "group",
"Country": "Country",
"Currency": "USD",
"Symbol": "EURUSD",
"Digits": 5,
"Cmd": "Buy",
"State": "OpenNormal",
"Activation": "None",
"Reason": "Dealer",
"Volume": 1.0,
"OpenTime": "2010-11-11T11:11:11",
"OpenPrice": 0.0,
"Sl": 1.0,
"Tp": 2.0,
"CloseTime": null,
"Expiration": "2017-05-17T19:13:15.907397+03:00",
"Commission": 0.15,
"CommissionAgent": 0.25,
"Swaps": 1.25,
"ClosePrice": 15.0,
"Profit": 150.0,
"ProfitWithTaxesUsd": 150.0,
"Taxes": 20.0,
"Comment": "comment",
"GwOrder": 23004,
"GwVolume": 1.01,
"GwOpenPrice": 3400000.0,
"GwClosePrice": 5500015.0,
"Timestamp": "2017-02-06T19:13:15.9083976+03:00"
}
],
"PageSize": 100,
"PageNum": 1,
"TotalRecords": 1,
"ResponseNode": "ResponseNodeAccountHistory"
}
}
],
"RequestId": "19f90fe9-aac7-4086-bdb6-e666d1d1346d",
"ResponseMaster": "ResponseAccountHistory"
}
The ProfitWithTaxesUsd field contains the profit in USD AT THE RATE AT THE TIME OF REQUEST, including swaps and commissions