MessageAdapter
The base adapter converts messages Message to the command of the trading system and back.
继承自: BaseLogReceiver
实现: IMessageAdapter, IMessageTransport, IPersistable, ILogReceiver, ILogSource, IDisposable, ICloneable<IMessageAdapter>, ICloneable, INotifyPropertyChanged
构造函数
MessageAdapter(IdGenerator)
Initialize MessageAdapter.
- transactionIdGenerator
- Transaction id generator.
属性
AssociatedBoards : string[]
The adapter can process subscription only with instruments associated with the specified board.
CandlesBuildFrom : IEnumerable<Level1Fields>
Possible options for candles building.
Categories : MessageAdapterCategories
Message adapter categories.
CheckTimeFrameByRequest : bool
Check possible time-frame by request.
DisconnectTimeout : TimeSpan
Gets the timeout to wait for a graceful disconnect.
EnqueueSubscriptions : bool
Enqueue subscriptions.
ExtraSetup : bool
The adapter requires extra setup.
FaultDelay : TimeSpan
Gets or sets the delay applied between faulted iterations.
FeatureName : string
Feature name.
FileSystem : IFileSystem
IFileSystem
HeartbeatBeforeConnect : bool
Start sending TimeMessage before connection established.
HeartbeatInterval : TimeSpan
Server check interval for track the connection alive. The value is Zero turned off tracking.
IsAutoReplyOnTransactonalUnsubscription : bool
Send auto response for OrderStatusMessage and PortfolioLookupMessage unsubscribes.
IsFullCandlesOnly : bool
Translates CandleMessage as only fully filled.
IsNativeIdentifiers : bool
Identify security in messages by native identifier Native.
IsNativeIdentifiersPersistable : bool
Native identifier can be stored.
IsPositionsEmulationRequired : bool?
Adapter required emulation PositionChangeMessage.
IsReplaceCommandEditCurrent : bool
Is the OrderReplaceMessage command edit a current order.
IsSecurityNewsOnly : bool
Adapter provides news related with specified security.
IsSupportExecutionsPnL : bool
Adapter fills PnL.
IsSupportOrderBookIncrements : bool
Adapter translates incremental order books.
IsSupportSubscriptions : bool
Support any subscriptions (ticks, order books etc.).
IsSupportTransactionLog : bool
Adapter translates orders changes on reply of OrderStatusMessage.
IterationInterval : TimeSpan
Interval between iterations.
LookupTimeout : TimeSpan?
Lookup timeout.
MaxParallelMessages : int
Gets or sets the maximum number of parallel (non-control) messages that can be processed. Must be greater than or equal to1.
NotSupportedResultMessages : IEnumerable<MessageTypes>
Not supported by adapter result message types.
OrderConditionType : Type
Type of OrderCondition.
Platform : Platforms
Bit process, which can run the adapter.
PossibleSupportedMessages : IEnumerable<MessageTypeInfo>
Possible supported message types.
ReConnectionSettings : ReConnectionSettings
Connection tracking settings IMessageAdapter with a server.
SecurityExtendedFields : IEnumerable<ValueTuple<string, Type>>
Names of extended security fields in SecurityMessage.
StorageName : string
Storage name.
SupportedInMessages : IEnumerable<MessageTypes>
Supported by adapter message types.
SupportedOrderBookDepths : IEnumerable<int>
Available options for MaxDepth.
TransactionIdGenerator : IdGenerator
Transaction id generator used for internal child subscription routing. Must be kept in sync with the parent adapter's generator.
UseInChannel : bool
Use channels for in messages.
UseOutChannel : bool
Use channels for out messages.
方法
CreateOrderLogMarketDepthBuilder(SecurityId) : IOrderLogMarketDepthBuilder
Create market depth builder.
- securityId
- Security ID.
返回值: Order log to market depth builder.
GetSupportedMarketDataTypesAsync(SecurityId, DateTime?, DateTime?) : IAsyncEnumerable<DataType>
Get supported by adapter message types.
- securityId
- SecurityId
- from
- Start date for request. If , then all available messages will be returned.
- to
- End date for request. If , then all available messages will be returned.
返回值: Supported by adapter market data types.
IsAllDownloadingSupported(DataType) : bool
Is for the specified all securities downloading enabled.
- dataType
- Data type info.
返回值: Check result.
IsSecurityRequired(DataType) : bool
Support filtering subscriptions (subscribe/unsubscribe for specified security).
- dataType
- Data type info.
返回值: Check result.
IsSupportCandlesPriceLevels(MarketDataMessage) : bool
Support candles PriceLevels.
- subscription
- MarketDataMessage
返回值: Check result.
IsSupportCandlesUpdates(MarketDataMessage) : bool
Support candles subscription and live updates.
- subscription
- MarketDataMessage
返回值: Check result.
OnCandlesSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for candles data. Override to provide implementation for candles subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnLevel1SubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for level1 data. Override to provide implementation for level1 subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnMarketDepthSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for market depth data. Override to provide implementation for market depth subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnNewsSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for news data. Override to provide implementation for news subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnOrderLogSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for order log (trades/transactions) data. Override to provide implementation for order log subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnPropertyChanged(string)
Raise PropertyChanged event.
- propertyName
- The name of the property that changed.
OnSendInMessageAsync(Message, CancellationToken) : ValueTask
Send in message handler.
- message
- Message
- cancellationToken
- CancellationToken
返回值: ValueTask
OnTFCandlesSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for time-frame candles (TF candles) data. Override to provide implementation for TF candles subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
OnTicksSubscriptionAsync(MarketDataMessage, CancellationToken) : ValueTask
Handles subscription request for ticks data. Override to provide implementation for ticks subscription processing. The default implementation throws NotSupported.
- mdMsg
- Market data subscription message.
- cancellationToken
- Cancellation token to cancel the operation.
返回值: A ValueTask representing the asynchronous operation.
SendInMessageAsync(Message, CancellationToken) : ValueTask
Processes a generic message asynchronously.
- message
- The message to process.
- cancellationToken
- CancellationToken
SendOutConnectionStateAsync(ConnectionStates, CancellationToken) : ValueTask
Send to CancellationToken) connection state message.
- state
- ConnectionStates
- cancellationToken
- Cancellation token.
SendOutDisconnectMessageAsync(bool, CancellationToken) : ValueTask
Send to CancellationToken) disconnect message.
- expected
- Is disconnect expected.
- cancellationToken
- Cancellation token.
SendOutDisconnectMessageAsync(Exception, CancellationToken) : ValueTask
Send to CancellationToken) disconnect message.
- error
- Error info. Can be .
- cancellationToken
- Cancellation token.
SendOutErrorAsync(string, CancellationToken) : ValueTask
Initialize a new message ErrorMessage and pass it to the method CancellationToken).
- description
- Error details.
- cancellationToken
- Cancellation token.
SendOutErrorAsync(Exception, CancellationToken) : ValueTask
Initialize a new message ErrorMessage and pass it to the method CancellationToken).
- error
- Error details.
- cancellationToken
- Cancellation token.
SendOutMessageAsync(Message, CancellationToken) : ValueTask
Send outgoing message (state change, order, etc.).
- message
- Message.
- cancellationToken
- CancellationToken
SendSubscriptionFinishedAsync(long, CancellationToken, DateTime?) : ValueTask
Initialize a new message SubscriptionFinishedMessage and pass it to the method CancellationToken).
- originalTransactionId
- ID of the original message for which this message is a response.
- cancellationToken
- Cancellation token.
- nextFrom
- NextFrom.
SendSubscriptionNotSupportedAsync(long, CancellationToken) : ValueTask
Initialize a new message SubscriptionResponseMessage and pass it to the method CancellationToken).
- originalTransactionId
- ID of the original message for which this message is a response.
- cancellationToken
- Cancellation token.
SendSubscriptionOnlineAsync(long, CancellationToken) : ValueTask
Initialize a new message SubscriptionOnlineMessage and pass it to the method CancellationToken).
- originalTransactionId
- ID of the original message for which this message is a response.
- cancellationToken
- Cancellation token.
SendSubscriptionReplyAsync(long, CancellationToken, Exception) : ValueTask
Initialize a new message SubscriptionResponseMessage and pass it to the method CancellationToken).
- originalTransactionId
- ID of the original message for which this message is a response.
- cancellationToken
- Cancellation token.
- error
- Subscribe or unsubscribe error info. To be set if the answer.
SendSubscriptionResultAsync(ISubscriptionMessage, CancellationToken) : ValueTask
Initialize a new message SubscriptionOnlineMessage or SubscriptionFinishedMessage and pass it to the method CancellationToken).
- message
- Subscription.
- cancellationToken
- Cancellation token.
ValidateSecurityId(SecurityId) : bool
Validate the specified security id is supported by the adapter and subscription can be done.
- secId
- SecurityId.
返回值: Check result.
事件
NewOutMessageAsync : Func<Message, CancellationToken, ValueTask>
New message event.