public class MetatraderPosition extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MetatraderPosition.PositionReason
Position opening reason.
|
static class |
MetatraderPosition.PositionType
Position type
|
| Modifier and Type | Field and Description |
|---|---|
Double |
accountCurrencyExchangeRate
Current exchange rate of account currency into account base currency (USD if you
did not override it), or
null |
String |
brokerTime
Time position was opened at, in broker timezone, YYYY-MM-DD HH:mm:ss.SSS format
|
String |
clientId
Client-assigned id or
null. |
String |
comment
Position comment or
null. |
double |
commission
Position commission
|
double |
currentPrice
Current price
|
double |
currentTickValue
Current tick value
|
String |
id
Position id (ticket number)
|
long |
magic
Position magic number, identifies the EA which opened the position
|
double |
openPrice
Position open price
|
String |
originalComment
Position original comment, or
null (present if possible to restore from history) |
Double |
profit
Position cumulative profit
|
Double |
realizedProfit
Profit of the already closed part, including commissions and swap
|
MetatraderPosition.PositionReason |
reason
Position opening reason
|
Double |
stopLoss
Position stop loss price or
null |
Double |
swap
Position cumulative swap
|
String |
symbol
Position symbol
|
Double |
takeProfit
Position take profit price or
null |
cloud.metaapi.sdk.clients.models.IsoTime |
time
Time position was opened at
|
MetatraderPosition.PositionType |
type
Position type
|
Double |
unrealizedProfit
Profit of the part of the position which is not yet closed, including swap
|
String |
updatePending
Flag indicating that position original comment and clientId was not identified
yet and will be updated in a future packet, or
null |
cloud.metaapi.sdk.clients.models.IsoTime |
updateTime
Last position modification time
|
double |
volume
Position volume
|
| Constructor and Description |
|---|
MetatraderPosition() |
public String id
public MetatraderPosition.PositionType type
public String symbol
public long magic
public cloud.metaapi.sdk.clients.models.IsoTime time
public String brokerTime
public cloud.metaapi.sdk.clients.models.IsoTime updateTime
public double openPrice
public double currentPrice
public double currentTickValue
public Double stopLoss
nullpublic Double takeProfit
nullpublic double volume
public Double swap
public Double profit
public String comment
null. The sum of the line lengths of the comment and
the clientId must be less than or equal to 26. For more information see
https://metaapi.cloud/docs/client/clientIdUsage/public String clientId
null. The id value can be assigned when submitting a trade and
will be present on position, history orders and history deals related to the trade.
You can use this field to bind your trades to objects in your application and then track trade progress.
The sum of the line lengths of the comment and the clientId must be less than or equal to 26.
For more information see https://metaapi.cloud/docs/client/clientIdUsage/public Double unrealizedProfit
public Double realizedProfit
public double commission
public MetatraderPosition.PositionReason reason
public Double accountCurrencyExchangeRate
nullpublic String originalComment
null (present if possible to restore from history)public String updatePending
nullCopyright © 2023. All rights reserved.