Trade#
About#
Contains a historical trade.
Fields#
Name | Type | Required | Description |
---|---|---|---|
_id | string | Yes | historical trade id |
accountId | string | Yes | MetaApi account id |
positionId | string | Yes | trade position id |
volume | number | Yes | trade volume |
durationInMinutes | number | Yes | trade duration in minutes |
profit | number | Yes | trade profit |
gain | number | Yes | trade gain |
success | string | Yes | trade success, enum: won , lost |
openTime | string | Yes | time the trade was opened at in broker timezone, YYYY-MM-DD HH:mm:ss.SSS format |
type | string | Yes | trade type, enum: DEAL_TYPE_BUY , DEAL_TYPE_SELL , DEAL_TYPE_BALANCE |
symbol | string | symbol the trade relates to | |
closeTime | string | time the trade was closed at in broker timezone, YYYY-MM-DD HH:mm:ss.SSS format | |
openPrice | number | trade opening price | |
closePrice | number | trade closing price | |
pips | number | the number of pips (price units) earned (positive) or lost (negative) in this trade | |
riskInBalancePercent | number | trade risk in % of balance | |
riskInPips | number | trade risk in pips | |
comment | string | position comment | |
marketValue | number | trade market value |
Example#
{
"_id": "AS_AUDNZD_3zfxXl3RvJ+1",
"accountId": "AS_AUDNZD_3zfxXl3RvJ",
"volume": 1,
"durationInMinutes": 16,
"profit": 3.01,
"gain": 106,
"success": "won",
"openTime": "2020-09-08 22:21:36.000",
"type": "DEAL_TYPE_BUY",
"symbol": "EURUSD",
"closeTime": "2020-09-08 24:37:36.000",
"openPrice": 1.1835,
"closePrice": 1.1935,
"pips": 100
}