Trading messages (register order, cancel order, subscribe market data etc.). More info on web site https://stocksharp.com/store/
$ dotnet add package StockSharp.MessagesThe Messages project contains the essential message definitions shared across the StockSharp (S#) trading framework. Messages are the contracts used by connectors, adapters and other services for all interactions such as connecting to brokers, requesting market data or placing orders.
MessageTypes lists every supported message kind.Message, BaseConnectionMessage and BaseSubscriptionMessage provide common fields and behaviour.MessageAdapter and AsyncMessageProcessor handle messages asynchronously.ReConnectionSettings control reconnection and subscription options.The library defines messages for all major trading activities:
ConnectMessage, DisconnectMessage, ConnectionLostMessage and ConnectionRestoredMessage.SecurityMessage, BoardMessage and BoardStateMessage.MarketDataMessageOrderRegisterMessage, OrderReplaceMessage, OrderCancelMessage, OrderGroupCancelMessage, OrderStatusMessage and ExecutionMessage.PortfolioMessage, PortfolioLookupMessage and PositionChangeMessage.TimeMessage, NewsMessage, ErrorMessage and others.The project targets .NET Standard 2.0 and .NET 6.0 for cross-platform compatibility.
Below is a minimal example of creating a market data subscription message:
using StockSharp.Messages;
var mdMessage = new MarketDataMessage
{
DataType2 = DataType.Ticks,
IsSubscribe = true,
TransactionId = 1,
SecurityId = new SecurityId
{
SecurityCode = "AAPL",
BoardCode = "NASDAQ"
}
};Such messages are passed to an adapter, which forwards them to the broker or data provider.
Further details on messages and architecture can be found in the StockSharp documentation.