Table of Contents

Description

Message contains information on market data, transactions or command. Below is a list of key messages, used in the 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.
PortfolioLookupMessage Requests portfolio information according to the given criteria. The request result returns by means of the PortfolioMessage 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 SecurityMessage.
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.
TimeFrameLookupMessage Requests list of supported timeframes. The request result returns by means of the TimeFrameInfoMessage.
TimeFrameInfoMessage Timeframes search result message.
SubscriptionResponseMessage A response of subscription request (subscribe or unsubscribe). In case of error, a description will be put into SubscriptionResponseMessage.Error.
SubscriptionOnlineMessage Message means a subscription goes online.
SubscriptionFinishedMessage Message means a subscription finished in case of received all necessary data.

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 ExecutionMessage.ExecutionType:

If the ExecutionTypes.Transaction type is used, it is about own orders or trades. At that, if the message contains the order information, the feature ExecutionMessage.HasOrderInfo = true, if there is information on trade, the feature ExecutionMessage.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.

	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);