ProtoOAPosition
* Trade position entity.
Implements: IMessage<ProtoOAPosition>, IMessage, IEquatable<ProtoOAPosition>, IDeepCloneable<ProtoOAPosition>, IBufferMessage
Properties
public long Commission { get; set; }
value = protoOAPosition.Commission
protoOAPosition.Commission = value
Current unrealized commission related to the position.
public bool GuaranteedStopLoss { get; set; }
value = protoOAPosition.GuaranteedStopLoss
protoOAPosition.GuaranteedStopLoss = value
If TRUE then position's stop loss is guaranteedStopLoss.
public bool HasCommission { get; }
value = protoOAPosition.HasCommission
Gets whether the "commission" field is set
public bool HasGuaranteedStopLoss { get; }
value = protoOAPosition.HasGuaranteedStopLoss
Gets whether the "guaranteedStopLoss" field is set
public bool HasMarginRate { get; }
value = protoOAPosition.HasMarginRate
Gets whether the "marginRate" field is set
public bool HasMirroringCommission { get; }
value = protoOAPosition.HasMirroringCommission
Gets whether the "mirroringCommission" field is set
public bool HasMoneyDigits { get; }
value = protoOAPosition.HasMoneyDigits
Gets whether the "moneyDigits" field is set
public bool HasPositionId { get; }
value = protoOAPosition.HasPositionId
Gets whether the "positionId" field is set
public bool HasPositionStatus { get; }
value = protoOAPosition.HasPositionStatus
Gets whether the "positionStatus" field is set
public bool HasPrice { get; }
value = protoOAPosition.HasPrice
Gets whether the "price" field is set
public bool HasStopLoss { get; }
value = protoOAPosition.HasStopLoss
Gets whether the "stopLoss" field is set
public bool HasStopLossTriggerMethod { get; }
value = protoOAPosition.HasStopLossTriggerMethod
Gets whether the "stopLossTriggerMethod" field is set
public bool HasSwap { get; }
value = protoOAPosition.HasSwap
Gets whether the "swap" field is set
public bool HasTakeProfit { get; }
value = protoOAPosition.HasTakeProfit
Gets whether the "takeProfit" field is set
public bool HasTrailingStopLoss { get; }
value = protoOAPosition.HasTrailingStopLoss
Gets whether the "trailingStopLoss" field is set
public bool HasUsedMargin { get; }
value = protoOAPosition.HasUsedMargin
Gets whether the "usedMargin" field is set
public bool HasUtcLastUpdateTimestamp { get; }
value = protoOAPosition.HasUtcLastUpdateTimestamp
Gets whether the "utcLastUpdateTimestamp" field is set
public double MarginRate { get; set; }
value = protoOAPosition.MarginRate
protoOAPosition.MarginRate = value
Rate for used margin computation. Represented as Base/Deposit.
public long MirroringCommission { get; set; }
value = protoOAPosition.MirroringCommission
protoOAPosition.MirroringCommission = value
Amount of unrealized commission related to following of strategy provider.
public uint MoneyDigits { get; set; }
value = protoOAPosition.MoneyDigits
protoOAPosition.MoneyDigits = value
Specifies the exponent of the monetary values. E.g. moneyDigits = 8 must be interpret as business value multiplied by 10^8, then real balance would be 10053099944 / 10^8 = 100.53099944. Affects swap, commission, mirroringCommission, usedMargin.
public long PositionId { get; set; }
value = protoOAPosition.PositionId
protoOAPosition.PositionId = value
The unique ID of the position. Note: trader might have two positions with the same id if positions are taken from accounts from different brokers.
public ProtoOAPositionStatus PositionStatus { get; set; }
value = protoOAPosition.PositionStatus
protoOAPosition.PositionStatus = value
Current status of the position.
public double Price { get; set; }
value = protoOAPosition.Price
protoOAPosition.Price = value
VWAP price of the position based on all executions (orders) linked to the position.
public double StopLoss { get; set; }
value = protoOAPosition.StopLoss
protoOAPosition.StopLoss = value
Current stop loss price.
public ProtoOAOrderTriggerMethod StopLossTriggerMethod { get; set; }
value = protoOAPosition.StopLossTriggerMethod
protoOAPosition.StopLossTriggerMethod = value
Stop trigger method for SL/TP of the position.
public long Swap { get; set; }
value = protoOAPosition.Swap
protoOAPosition.Swap = value
Total amount of charged swap on open position.
public double TakeProfit { get; set; }
value = protoOAPosition.TakeProfit
protoOAPosition.TakeProfit = value
Current take profit price.
public ProtoOATradeData TradeData { get; set; }
value = protoOAPosition.TradeData
protoOAPosition.TradeData = value
Position details. See ProtoOATradeData for details.
public bool TrailingStopLoss { get; set; }
value = protoOAPosition.TrailingStopLoss
protoOAPosition.TrailingStopLoss = value
If TRUE then the Trailing Stop Loss is applied.
public ulong UsedMargin { get; set; }
value = protoOAPosition.UsedMargin
protoOAPosition.UsedMargin = value
Amount of margin used for the position in deposit currency.
public long UtcLastUpdateTimestamp { get; set; }
value = protoOAPosition.UtcLastUpdateTimestamp
protoOAPosition.UtcLastUpdateTimestamp = value
The Unix time in milliseconds of the last change of the position, including amend SL/TP of the position, execution of related order, cancel or related order, etc.
Methods
public void ClearCommission()
protoOAPosition.ClearCommission()
Clears the value of the "commission" field
public void ClearGuaranteedStopLoss()
protoOAPosition.ClearGuaranteedStopLoss()
Clears the value of the "guaranteedStopLoss" field
public void ClearMarginRate()
protoOAPosition.ClearMarginRate()
Clears the value of the "marginRate" field
public void ClearMirroringCommission()
protoOAPosition.ClearMirroringCommission()
Clears the value of the "mirroringCommission" field
public void ClearMoneyDigits()
protoOAPosition.ClearMoneyDigits()
Clears the value of the "moneyDigits" field
public void ClearPositionId()
protoOAPosition.ClearPositionId()
Clears the value of the "positionId" field
public void ClearPositionStatus()
protoOAPosition.ClearPositionStatus()
Clears the value of the "positionStatus" field
public void ClearPrice()
protoOAPosition.ClearPrice()
Clears the value of the "price" field
public void ClearStopLoss()
protoOAPosition.ClearStopLoss()
Clears the value of the "stopLoss" field
public void ClearStopLossTriggerMethod()
protoOAPosition.ClearStopLossTriggerMethod()
Clears the value of the "stopLossTriggerMethod" field
public void ClearTakeProfit()
protoOAPosition.ClearTakeProfit()
Clears the value of the "takeProfit" field
public void ClearTrailingStopLoss()
protoOAPosition.ClearTrailingStopLoss()
Clears the value of the "trailingStopLoss" field
public void ClearUsedMargin()
protoOAPosition.ClearUsedMargin()
Clears the value of the "usedMargin" field
public void ClearUtcLastUpdateTimestamp()
protoOAPosition.ClearUtcLastUpdateTimestamp()
Clears the value of the "utcLastUpdateTimestamp" field
Fields
public const int CommissionFieldNumber
value = ProtoOAPosition.CommissionFieldNumber
Field number for the "commission" field.
public const int GuaranteedStopLossFieldNumber
value = ProtoOAPosition.GuaranteedStopLossFieldNumber
Field number for the "guaranteedStopLoss" field.
public const int MarginRateFieldNumber
value = ProtoOAPosition.MarginRateFieldNumber
Field number for the "marginRate" field.
public const int MirroringCommissionFieldNumber
value = ProtoOAPosition.MirroringCommissionFieldNumber
Field number for the "mirroringCommission" field.
public const int MoneyDigitsFieldNumber
value = ProtoOAPosition.MoneyDigitsFieldNumber
Field number for the "moneyDigits" field.
public const int PositionIdFieldNumber
value = ProtoOAPosition.PositionIdFieldNumber
Field number for the "positionId" field.
public const int PositionStatusFieldNumber
value = ProtoOAPosition.PositionStatusFieldNumber
Field number for the "positionStatus" field.
public const int PriceFieldNumber
value = ProtoOAPosition.PriceFieldNumber
Field number for the "price" field.
public const int StopLossFieldNumber
value = ProtoOAPosition.StopLossFieldNumber
Field number for the "stopLoss" field.
public const int StopLossTriggerMethodFieldNumber
value = ProtoOAPosition.StopLossTriggerMethodFieldNumber
Field number for the "stopLossTriggerMethod" field.
public const int SwapFieldNumber
value = ProtoOAPosition.SwapFieldNumber
Field number for the "swap" field.
public const int TakeProfitFieldNumber
value = ProtoOAPosition.TakeProfitFieldNumber
Field number for the "takeProfit" field.
public const int TradeDataFieldNumber
value = ProtoOAPosition.TradeDataFieldNumber
Field number for the "tradeData" field.
public const int TrailingStopLossFieldNumber
value = ProtoOAPosition.TrailingStopLossFieldNumber
Field number for the "trailingStopLoss" field.
public const int UsedMarginFieldNumber
value = ProtoOAPosition.UsedMarginFieldNumber
Field number for the "usedMargin" field.
public const int UtcLastUpdateTimestampFieldNumber
value = ProtoOAPosition.UtcLastUpdateTimestampFieldNumber
Field number for the "utcLastUpdateTimestamp" field.