Table of Contents

Class Position

Namespace
StockSharp.BusinessEntities
Assembly
StockSharp.BusinessEntities.dll

The position by the instrument.

[DataContract]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Position", Description = "PositionDesc")]
public class Position : NotifiableObject, ILocalTimeMessage, IServerTimeMessage
Inheritance
Position
Implements
Derived
Extension Methods

Constructors

Position()

Initializes a new instance of the Position.

public Position()

Properties

AveragePrice

Average price.

[Display(ResourceType = typeof(LocalizedStrings), Name = "AveragePrice", Description = "AveragePriceCalcTrades", GroupName = "Statistics")]
[Browsable(false)]
public decimal? AveragePrice { get; set; }

Property Value

decimal?

BeginValue

Position size at the beginning of the trading session.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "BeginValue", Description = "PosBeginValue", GroupName = "Statistics")]
[Browsable(false)]
public decimal? BeginValue { get; set; }

Property Value

decimal?

BlockedValue

Position size, registered for active orders.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Blocked", Description = "PosBlockedSize", GroupName = "Statistics")]
[Browsable(false)]
public decimal? BlockedValue { get; set; }

Property Value

decimal?

BuyOrdersCount

Orders (bids).

[Browsable(false)]
public int? BuyOrdersCount { get; set; }

Property Value

int?

BuyOrdersMargin

Margin (buy).

[Browsable(false)]
public decimal? BuyOrdersMargin { get; set; }

Property Value

decimal?

ClientCode

Client code assigned by the broker.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "ClientCode", Description = "ClientCodeDesc", GroupName = "General")]
public string ClientCode { get; set; }

Property Value

string

Commission

Total commission.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Commission", Description = "TotalCommissionDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? Commission { get; set; }

Property Value

decimal?

CommissionMaker

Commission (maker).

[Browsable(false)]
public decimal? CommissionMaker { get; set; }

Property Value

decimal?

CommissionTaker

Commission (taker).

[Browsable(false)]
public decimal? CommissionTaker { get; set; }

Property Value

decimal?

Currency

Portfolio currency.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Currency", Description = "PortfolioCurrency", GroupName = "General")]
public CurrencyTypes? Currency { get; set; }

Property Value

CurrencyTypes?

CurrentPrice

Position price.

[Display(ResourceType = typeof(LocalizedStrings), Name = "PosPrice", Description = "PosPriceDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? CurrentPrice { get; set; }

Property Value

decimal?

CurrentValue

Current position size.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "CurrentValue", Description = "CurrentPosSize", GroupName = "Statistics")]
public decimal? CurrentValue { get; set; }

Property Value

decimal?

DepoName

The depositary where the physical security.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Depo", Description = "DepoName", GroupName = "General")]
[DataMember]
public string DepoName { get; set; }

Property Value

string

Description

Text position description.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Description", Description = "PosText", GroupName = "General")]
public string Description { get; set; }

Property Value

string

ExpirationDate

Expiration date.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "ExpiryDate", Description = "ExpiryDate", GroupName = "General")]
public DateTimeOffset? ExpirationDate { get; set; }

Property Value

DateTimeOffset?

LastChangeTime

Time of last position change.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Changed", Description = "TimePosLastChange", GroupName = "Statistics")]
[Browsable(false)]
public DateTimeOffset LastChangeTime { get; set; }

Property Value

DateTimeOffset

Leverage

Margin leverage.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Leverage", Description = "MarginLeverage", GroupName = "General")]
public decimal? Leverage { get; set; }

Property Value

decimal?

LimitType

Limit type for Т+ market.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Limit", Description = "PosLimit", GroupName = "General")]
[DataMember]
public TPlusLimits? LimitType { get; set; }

Property Value

TPlusLimits?

LiquidationPrice

Liquidation price.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "LiquidationPrice", Description = "LiquidationPrice", GroupName = "Statistics")]
[Browsable(false)]
public decimal? LiquidationPrice { get; set; }

Property Value

decimal?

LocalTime

Local time of the last position change.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "LocalTime", Description = "LocalTimeDesc", GroupName = "Statistics")]
[Browsable(false)]
public DateTimeOffset LocalTime { get; set; }

Property Value

DateTimeOffset

OrdersCount

Orders.

[Browsable(false)]
public int? OrdersCount { get; set; }

Property Value

int?

OrdersMargin

Orders (margin).

[Browsable(false)]
public decimal? OrdersMargin { get; set; }

Property Value

decimal?

Portfolio

Portfolio, in which position is created.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Portfolio", Description = "PosPortfolio", GroupName = "General")]
public Portfolio Portfolio { get; set; }

Property Value

Portfolio

RealizedPnL

Realized profit.

[Display(ResourceType = typeof(LocalizedStrings), Name = "RealizedProfit", Description = "RealizedProfitDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? RealizedPnL { get; set; }

Property Value

decimal?

Security

Security, for which a position was created.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Security", Description = "PosSecurity", GroupName = "General")]
public Security Security { get; set; }

Property Value

Security

SellOrdersCount

Orders (asks).

[Browsable(false)]
public int? SellOrdersCount { get; set; }

Property Value

int?

SellOrdersMargin

Margin (sell).

[Browsable(false)]
public decimal? SellOrdersMargin { get; set; }

Property Value

decimal?

SettlementPrice

Settlement price.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "SettlementPrice", Description = "SettlementPriceDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? SettlementPrice { get; set; }

Property Value

decimal?

Side

Side.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Side", Description = "PosSide", GroupName = "General", Order = 101)]
public virtual Sides? Side { get; set; }

Property Value

Sides?

StrategyId

Strategy id.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Strategy", Description = "Identifier", GroupName = "General", Order = 100)]
public virtual string StrategyId { get; set; }

Property Value

string

TradesCount

Trades.

[Browsable(false)]
public int? TradesCount { get; set; }

Property Value

int?

UnrealizedPnL

Unrealized profit.

[Display(ResourceType = typeof(LocalizedStrings), Name = "UnrealizedProfit", Description = "UnrealizedProfitDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? UnrealizedPnL { get; set; }

Property Value

decimal?

VariationMargin

Variation margin.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "VariationMargin", Description = "VariationMarginDesc", GroupName = "Statistics")]
[Browsable(false)]
public decimal? VariationMargin { get; set; }

Property Value

decimal?

Methods

Clone()

Create a copy of Position.

public virtual Position Clone()

Returns

Position

Copy.

CopyTo(Position)

To copy fields of the current position to destination.

public void CopyTo(Position destination)

Parameters

destination Position

The position in which you should to copy fields.

ToString()

public override string ToString()

Returns

string