ProtoOAPosition

StockSharp.cTrader.Native.Model

* Trade position entity.

Implements: IMessage<ProtoOAPosition>, IMessage, IEquatable<ProtoOAPosition>, IDeepCloneable<ProtoOAPosition>, IBufferMessage

Properties

Commission
public long Commission { get; set; }
value = protoOAPosition.Commission
protoOAPosition.Commission = value

Current unrealized commission related to the position.

GuaranteedStopLoss
public bool GuaranteedStopLoss { get; set; }
value = protoOAPosition.GuaranteedStopLoss
protoOAPosition.GuaranteedStopLoss = value

If TRUE then position's stop loss is guaranteedStopLoss.

HasCommission
public bool HasCommission { get; }
value = protoOAPosition.HasCommission

Gets whether the "commission" field is set

HasGuaranteedStopLoss
public bool HasGuaranteedStopLoss { get; }
value = protoOAPosition.HasGuaranteedStopLoss

Gets whether the "guaranteedStopLoss" field is set

HasMarginRate
public bool HasMarginRate { get; }
value = protoOAPosition.HasMarginRate

Gets whether the "marginRate" field is set

HasMirroringCommission
public bool HasMirroringCommission { get; }
value = protoOAPosition.HasMirroringCommission

Gets whether the "mirroringCommission" field is set

HasMoneyDigits
public bool HasMoneyDigits { get; }
value = protoOAPosition.HasMoneyDigits

Gets whether the "moneyDigits" field is set

HasPositionId
public bool HasPositionId { get; }
value = protoOAPosition.HasPositionId

Gets whether the "positionId" field is set

HasPositionStatus
public bool HasPositionStatus { get; }
value = protoOAPosition.HasPositionStatus

Gets whether the "positionStatus" field is set

HasPrice
public bool HasPrice { get; }
value = protoOAPosition.HasPrice

Gets whether the "price" field is set

HasStopLoss
public bool HasStopLoss { get; }
value = protoOAPosition.HasStopLoss

Gets whether the "stopLoss" field is set

HasStopLossTriggerMethod
public bool HasStopLossTriggerMethod { get; }
value = protoOAPosition.HasStopLossTriggerMethod

Gets whether the "stopLossTriggerMethod" field is set

HasSwap
public bool HasSwap { get; }
value = protoOAPosition.HasSwap

Gets whether the "swap" field is set

HasTakeProfit
public bool HasTakeProfit { get; }
value = protoOAPosition.HasTakeProfit

Gets whether the "takeProfit" field is set

HasTrailingStopLoss
public bool HasTrailingStopLoss { get; }
value = protoOAPosition.HasTrailingStopLoss

Gets whether the "trailingStopLoss" field is set

HasUsedMargin
public bool HasUsedMargin { get; }
value = protoOAPosition.HasUsedMargin

Gets whether the "usedMargin" field is set

HasUtcLastUpdateTimestamp
public bool HasUtcLastUpdateTimestamp { get; }
value = protoOAPosition.HasUtcLastUpdateTimestamp

Gets whether the "utcLastUpdateTimestamp" field is set

MarginRate
public double MarginRate { get; set; }
value = protoOAPosition.MarginRate
protoOAPosition.MarginRate = value

Rate for used margin computation. Represented as Base/Deposit.

MirroringCommission
public long MirroringCommission { get; set; }
value = protoOAPosition.MirroringCommission
protoOAPosition.MirroringCommission = value

Amount of unrealized commission related to following of strategy provider.

MoneyDigits
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.

PositionId
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.

PositionStatus
public ProtoOAPositionStatus PositionStatus { get; set; }
value = protoOAPosition.PositionStatus
protoOAPosition.PositionStatus = value

Current status of the position.

Price
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.

StopLoss
public double StopLoss { get; set; }
value = protoOAPosition.StopLoss
protoOAPosition.StopLoss = value

Current stop loss price.

StopLossTriggerMethod
public ProtoOAOrderTriggerMethod StopLossTriggerMethod { get; set; }
value = protoOAPosition.StopLossTriggerMethod
protoOAPosition.StopLossTriggerMethod = value

Stop trigger method for SL/TP of the position.

Swap
public long Swap { get; set; }
value = protoOAPosition.Swap
protoOAPosition.Swap = value

Total amount of charged swap on open position.

TakeProfit
public double TakeProfit { get; set; }
value = protoOAPosition.TakeProfit
protoOAPosition.TakeProfit = value

Current take profit price.

TradeData
public ProtoOATradeData TradeData { get; set; }
value = protoOAPosition.TradeData
protoOAPosition.TradeData = value

Position details. See ProtoOATradeData for details.

TrailingStopLoss
public bool TrailingStopLoss { get; set; }
value = protoOAPosition.TrailingStopLoss
protoOAPosition.TrailingStopLoss = value

If TRUE then the Trailing Stop Loss is applied.

UsedMargin
public ulong UsedMargin { get; set; }
value = protoOAPosition.UsedMargin
protoOAPosition.UsedMargin = value

Amount of margin used for the position in deposit currency.

UtcLastUpdateTimestamp
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

ClearCommission
public void ClearCommission()
protoOAPosition.ClearCommission()

Clears the value of the "commission" field

ClearGuaranteedStopLoss
public void ClearGuaranteedStopLoss()
protoOAPosition.ClearGuaranteedStopLoss()

Clears the value of the "guaranteedStopLoss" field

ClearMarginRate
public void ClearMarginRate()
protoOAPosition.ClearMarginRate()

Clears the value of the "marginRate" field

ClearMirroringCommission
public void ClearMirroringCommission()
protoOAPosition.ClearMirroringCommission()

Clears the value of the "mirroringCommission" field

ClearMoneyDigits
public void ClearMoneyDigits()
protoOAPosition.ClearMoneyDigits()

Clears the value of the "moneyDigits" field

ClearPositionId
public void ClearPositionId()
protoOAPosition.ClearPositionId()

Clears the value of the "positionId" field

ClearPositionStatus
public void ClearPositionStatus()
protoOAPosition.ClearPositionStatus()

Clears the value of the "positionStatus" field

ClearPrice
public void ClearPrice()
protoOAPosition.ClearPrice()

Clears the value of the "price" field

ClearStopLoss
public void ClearStopLoss()
protoOAPosition.ClearStopLoss()

Clears the value of the "stopLoss" field

ClearStopLossTriggerMethod
public void ClearStopLossTriggerMethod()
protoOAPosition.ClearStopLossTriggerMethod()

Clears the value of the "stopLossTriggerMethod" field

ClearSwap
public void ClearSwap()
protoOAPosition.ClearSwap()

Clears the value of the "swap" field

ClearTakeProfit
public void ClearTakeProfit()
protoOAPosition.ClearTakeProfit()

Clears the value of the "takeProfit" field

ClearTrailingStopLoss
public void ClearTrailingStopLoss()
protoOAPosition.ClearTrailingStopLoss()

Clears the value of the "trailingStopLoss" field

ClearUsedMargin
public void ClearUsedMargin()
protoOAPosition.ClearUsedMargin()

Clears the value of the "usedMargin" field

ClearUtcLastUpdateTimestamp
public void ClearUtcLastUpdateTimestamp()
protoOAPosition.ClearUtcLastUpdateTimestamp()

Clears the value of the "utcLastUpdateTimestamp" field

Fields

CommissionFieldNumber
public const int CommissionFieldNumber
value = ProtoOAPosition.CommissionFieldNumber

Field number for the "commission" field.

GuaranteedStopLossFieldNumber
public const int GuaranteedStopLossFieldNumber
value = ProtoOAPosition.GuaranteedStopLossFieldNumber

Field number for the "guaranteedStopLoss" field.

MarginRateFieldNumber
public const int MarginRateFieldNumber
value = ProtoOAPosition.MarginRateFieldNumber

Field number for the "marginRate" field.

MirroringCommissionFieldNumber
public const int MirroringCommissionFieldNumber
value = ProtoOAPosition.MirroringCommissionFieldNumber

Field number for the "mirroringCommission" field.

MoneyDigitsFieldNumber
public const int MoneyDigitsFieldNumber
value = ProtoOAPosition.MoneyDigitsFieldNumber

Field number for the "moneyDigits" field.

PositionIdFieldNumber
public const int PositionIdFieldNumber
value = ProtoOAPosition.PositionIdFieldNumber

Field number for the "positionId" field.

PositionStatusFieldNumber
public const int PositionStatusFieldNumber
value = ProtoOAPosition.PositionStatusFieldNumber

Field number for the "positionStatus" field.

PriceFieldNumber
public const int PriceFieldNumber
value = ProtoOAPosition.PriceFieldNumber

Field number for the "price" field.

StopLossFieldNumber
public const int StopLossFieldNumber
value = ProtoOAPosition.StopLossFieldNumber

Field number for the "stopLoss" field.

StopLossTriggerMethodFieldNumber
public const int StopLossTriggerMethodFieldNumber
value = ProtoOAPosition.StopLossTriggerMethodFieldNumber

Field number for the "stopLossTriggerMethod" field.

SwapFieldNumber
public const int SwapFieldNumber
value = ProtoOAPosition.SwapFieldNumber

Field number for the "swap" field.

TakeProfitFieldNumber
public const int TakeProfitFieldNumber
value = ProtoOAPosition.TakeProfitFieldNumber

Field number for the "takeProfit" field.

TradeDataFieldNumber
public const int TradeDataFieldNumber
value = ProtoOAPosition.TradeDataFieldNumber

Field number for the "tradeData" field.

TrailingStopLossFieldNumber
public const int TrailingStopLossFieldNumber
value = ProtoOAPosition.TrailingStopLossFieldNumber

Field number for the "trailingStopLoss" field.

UsedMarginFieldNumber
public const int UsedMarginFieldNumber
value = ProtoOAPosition.UsedMarginFieldNumber

Field number for the "usedMargin" field.

UtcLastUpdateTimestampFieldNumber
public const int UtcLastUpdateTimestampFieldNumber
value = ProtoOAPosition.UtcLastUpdateTimestampFieldNumber

Field number for the "utcLastUpdateTimestamp" field.