Table of Contents

Class Trade

Namespace
StockSharp.BusinessEntities
Assembly
StockSharp.BusinessEntities.dll

Tick trade.

[DataContract]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Trade", Description = "TickTrade")]
[Obsolete("Use ITickTradeMessage.")]
public class Trade : Cloneable<Trade>, ITickTradeMessage, ISecurityIdMessage, ISeqNumMessage, ICurrencyMessage, ISystemMessage, IServerTimeMessage, IGeneratedMessage, ILocalTimeMessage, IComplexIdMessage
Inheritance
Trade
Implements
Extension Methods

Constructors

Trade()

Initializes a new instance of the Trade.

public Trade()

Properties

BuildFrom

Determines the message is generated from the specified DataType.

public DataType BuildFrom { get; set; }

Property Value

DataType

Currency

Trading security currency.

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

Property Value

CurrencyTypes?

Id

ID.

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

Property Value

long?

IsSystem

Is a system.

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

Property Value

bool?

IsUpTick

Is tick ascending or descending in price.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "UpTrend", Description = "UpTrendDesc", GroupName = "Statistics", Order = 11)]
public bool? IsUpTick { get; set; }

Property Value

bool?

LocalTime

Local timestamp when a message was received/created.

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

Property Value

DateTimeOffset

OpenInterest

Number of open positions (open interest).

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

Property Value

decimal?

OrderBuyId

Order id (buy).

[DataMember]
public long? OrderBuyId { get; set; }

Property Value

long?

OrderDirection

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

Property Value

Sides?

OrderSellId

Order id (sell).

[DataMember]
public long? OrderSellId { get; set; }

Property Value

long?

OriginSide

Order side (buy or sell), which led to the trade.

[DataMember]
[Display(ResourceType = typeof(LocalizedStrings), Name = "Initiator", Description = "DirectionDesc", GroupName = "General", Order = 5)]
public Sides? OriginSide { get; set; }

Property Value

Sides?

Price

Trade price.

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

Property Value

decimal

Security

The instrument, on which the trade was completed.

[Browsable(false)]
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 = "Time", Description = "TradeTime", GroupName = "General", Order = 3)]
public DateTimeOffset ServerTime { get; set; }

Property Value

DateTimeOffset

Status

System status.

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

Property Value

long?

StringId

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

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

Property Value

string

Time

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

Property Value

DateTimeOffset

Volume

Number of contracts in the trade.

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

Property Value

decimal

Yield

Yield.

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

Property Value

decimal?

Methods

Clone()

Create a copy of Trade.

public override Trade Clone()

Returns

Trade

Copy.

GetHashCode()

Get the hash code of the object Trade.

public override int GetHashCode()

Returns

int

A hash code.

ToString()

public override string ToString()

Returns

string