Table of Contents

Class Order

Namespace
StockSharp.BusinessEntities
Assembly
StockSharp.BusinessEntities.dll

Order.

[DataContract]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Order", Description = "InfoAboutOrder")]
public class Order : NotifiableObject, IOrderMessage, ISecurityIdMessage, ILocalTimeMessage, IServerTimeMessage, IComplexIdMessage, IGeneratedMessage, ISeqNumMessage, ICurrencyMessage, ISystemMessage
Inheritance
Order
Implements
Extension Methods

Constructors

Order()

Initializes a new instance of the Order.

public Order()

Properties

AveragePrice

Average execution price.

[DataMember]
public decimal? AveragePrice { get; set; }

Property Value

decimal?

Balance

Order contracts balance.

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

Property Value

decimal

BoardId

Board order id. Uses in case of Id and StringId is a brokerage system ids.

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

Property Value

string

BrokerCode

Broker firm code.

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

Property Value

string

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

Comment

Placed order comment.

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

Property Value

string

Commission

Commission (broker, exchange etc.).

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

Property Value

decimal?

CommissionCurrency

Commission currency. Can be null.

public string CommissionCurrency { get; set; }

Property Value

string

Condition

Order condition (e.g., stop- and algo- orders parameters).

[Display(ResourceType = typeof(LocalizedStrings), Name = "Condition", Description = "OrderConditionDesc", GroupName = "ConditionalOrder")]
public OrderCondition Condition { get; set; }

Property Value

OrderCondition

Currency

Trading security currency.

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

Property Value

CurrencyTypes?

DerivedOrder

Exchange order that was created by the stop-order when the condition is activated (null if a stop condition has not been activated).

[Display(ResourceType = typeof(LocalizedStrings), Name = "LinkedOrder", Description = "LinkedOrderDesc", GroupName = "ConditionalOrder")]
[Obsolete("No longer used.")]
public Order DerivedOrder { get; set; }

Property Value

Order

Direction

Order side (buy or sell).

[Browsable(false)]
[Obsolete("Use Direction property.")]
public Sides Direction { get; set; }

Property Value

Sides

ExpiryDate

Order expiry time. The default is null, which mean (GTC).

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

Property Value

DateTimeOffset?

Remarks

If the value is null, then the order is registered until cancel. Otherwise, the period is specified.

Id

Order ID.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Identifier", Description = "IdStringDot", GroupName = "General")]
public long? Id { get; set; }

Property Value

long?

IsManual

Is order manual.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Manual", Description = "IsOrderManual", GroupName = "General")]
public bool? IsManual { get; set; }

Property Value

bool?

IsMargin

Is margin enabled.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Margin", Description = "IsMargin", GroupName = "General")]
public bool? IsMargin { get; set; }

Property Value

bool?

IsMarketMaker

Is the order of market-maker.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "MarketMaker", Description = "MarketMakerOrderDot", GroupName = "General")]
public bool? IsMarketMaker { get; set; }

Property Value

bool?

IsSystem

Is a system trade.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "System", Description = "IsSystemTrade", GroupName = "General")]
public bool? IsSystem { get; set; }

Property Value

bool?

LastChangeTime

Time of last order change (Cancellation, Fill).

[Obsolete("Use LastChangeTime property.")]
[Browsable(false)]
public DateTimeOffset LastChangeTime { get; set; }

Property Value

DateTimeOffset

LatencyCancellation

Time taken to cancel an order.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Cancellation", Description = "OrderCancelLatency", GroupName = "Latency", Order = 1001)]
public TimeSpan? LatencyCancellation { get; set; }

Property Value

TimeSpan?

LatencyEdition

Time taken to edit an order.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Edition", Description = "EditionLatency", GroupName = "Latency", Order = 1002)]
public TimeSpan? LatencyEdition { get; set; }

Property Value

TimeSpan?

LatencyRegistration

Time taken to register an order.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Registration", Description = "OrderRegLatency", GroupName = "Latency", Order = 1000)]
public TimeSpan? LatencyRegistration { get; set; }

Property Value

TimeSpan?

Leverage

Margin leverage.

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

Property Value

int?

LocalTime

Last order change local time (Cancellation, Fill).

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

Property Value

DateTimeOffset

MinVolume

Minimum quantity of an order to be executed.

[DataMember]
public decimal? MinVolume { get; set; }

Property Value

decimal?

Portfolio

Portfolio, in which the order is being traded.

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

Property Value

Portfolio

PositionEffect

Position effect.

[DataMember]
public OrderPositionEffects? PositionEffect { get; set; }

Property Value

OrderPositionEffects?

PostOnly

Post-only order.

[DataMember]
public bool? PostOnly { get; set; }

Property Value

bool?

Price

Order price.

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

Property Value

decimal

Security

Security, for which an order is being placed.

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

Property Value

Security

SeqNum

Sequence number.

[DataMember]
public long SeqNum { get; set; }

Property Value

long

Remarks

Zero means no information.

ServerTime

Server time.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Changed", Description = "OrderLastChangeTime", GroupName = "General")]
public DateTimeOffset ServerTime { get; set; }

Property Value

DateTimeOffset

Side

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Direction", Description = "OrderSideDesc", GroupName = "General")]
public Sides Side { get; set; }

Property Value

Sides

Slippage

Slippage in trade price.

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

Property Value

decimal?

State

Order state.

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

Property Value

OrderStates

Status

System order status.

[DataMember]
[Browsable(false)]
public long? Status { get; set; }

Property Value

long?

StrategyId

Strategy id.

[DataMember]
public string StrategyId { get; set; }

Property Value

string

StringId

Order ID (as string, if electronic board does not use numeric order ID representation).

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

Property Value

string

Time

Order placing time on exchange.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "RegTime", Description = "RegTimeDesc", GroupName = "General")]
public DateTimeOffset Time { get; set; }

Property Value

DateTimeOffset

TimeInForce

Limit order time in force.

[Display(ResourceType = typeof(LocalizedStrings), Name = "TimeInForce", Description = "LimitOrderTif", GroupName = "General")]
public TimeInForce? TimeInForce { get; set; }

Property Value

TimeInForce?

TransactionId

Transaction ID. Automatically set when the RegisterOrder(Order) method called.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Transaction", Description = "TransactionIdDot", GroupName = "General")]
public long TransactionId { get; set; }

Property Value

long

Type

Order type.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "OrderType", Description = "OrderTypeDesc", GroupName = "General")]
public OrderTypes? Type { get; set; }

Property Value

OrderTypes?

UserOrderId

User's order ID.

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

Property Value

string

VisibleVolume

Visible quantity of contracts in order.

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

Property Value

decimal?

Volume

Number of contracts in the order.

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

Property Value

decimal

Yield

Yield.

[DataMember]
public decimal? Yield { get; set; }

Property Value

decimal?

Methods

ToString()

public override string ToString()

Returns

string