Click or drag to resize

Description

Message contains information on market data, transactions or command. Below is a list of key messages, used in the S#.API.

Message

Description

Message

Abstract class of messages, from which other messages classes are inheriting. Contains information on time, type MessageTypes and local time, when has created the message.

BoardMessage

Contains information on electronic trade board.

CandleMessage

Abstract class of message, containing general information on candle. Message classes for specific candle types are inheriting from this class: TimeFrameCandleMessage, TickCandleMessage, VolumeCandleMessage, RangeCandleMessage, PnFCandleMessage and RenkoCandleMessage.

ConnectMessage

Used as command for establishing connection, as well as for incoming message on successful connection or connection error.

DisconnectMessage

Used as command for disconnection, as well as for outgoing message on successful disconnection.

ErrorMessage

Error message.

ExecutionMessage

See description below.

Level1ChangeMessage

The message contains information on value of the level1 field of the certain type. Available field types are determined in the listing Level1Fields.

NewsMessage

The message contains information on news.

OrderCancelMessage

The message contains information for order cancelling. Also, there is the OrderGroupCancelMessage message, containing information for cancelling a group of orders by filter.

OrderRegisterMessage

The message contains information for orders registering.

OrderStatusMessage

The message contains information on current registered orders and trades.

OrderReplaceMessage

The message contains information for order replacement.

PortfolioMessage

Contains portfolio information. Also, there is the PortfolioChangeMessage message - information on portfolio changes.

PortfolioLookupMessage

Requests portfolio information according to the given criteria. The request result returns by means of the PortfolioLookupResultMessage message.

PositionChangeMessage

Contains position information. Containing information on change of the position's certain feature. The feature type is determined in the listing PositionChangeTypes.

QuoteChangeMessage

Contains information on the order book quotes.

ResetMessage

Status reset.

SecurityMessage

Contains instrument information.

SecurityLookupMessage

Requests list of instruments according to the given criteria. The request result returns by means of the SecurityLookupResultMessage.

BoardStateMessage

Contains information on trading session statute changes. Available values of the session statute are determined in the listing SessionStates.

TimeMessage

Contains current time information.

Message ExecutionMessage is a universal message, allowing transmission of various information, related to orders, own trades, tick trades and order log.

Type of information in the message is determined by value of the property ExecutionType:

If the Transaction type is used, it is about own orders or trades. At that, if the message contains the order information, the feature HasOrderInfo = true, if there is information on trade, the feature HasTradeInfo = true. Please note, that own trade contains information on the trade itself and on the order, related to this trade. Therefore, in this case the abovementioned features have the true value. These features allow differentiating the messages with own trades and orders.

S# contains a set of extension methods to convert trade objects to messages and vice versa. For example, order Order can be converted into message ExecutionMessage, and vice verse, as it is shown in the next code portion.

C#
var security = new Security() {Id = "ESM6@BATS" };

// sample Order's instance
var order = new Order();

// converting to message
var message = order.ToMessage();

// and back to Order's instance
var order1 = message.ToOrder(security);