Table of Contents

Class MessageAdapterWrapper

Namespace
StockSharp.Messages
Assembly
StockSharp.Messages.dll

Base implementation of IMessageAdapterWrapper.

public abstract class MessageAdapterWrapper : Cloneable<IMessageAdapter>, IMessageAdapterWrapper, IMessageAdapter, IMessageTransport, IPersistable, ILogReceiver, ILogSource, IDisposable, ICloneable<IMessageAdapter>, ICloneable
Inheritance
MessageAdapterWrapper
Implements
Derived
Inherited Members
Extension Methods

Constructors

MessageAdapterWrapper(IMessageAdapter)

protected MessageAdapterWrapper(IMessageAdapter innerAdapter)

Parameters

innerAdapter IMessageAdapter

Underlying adapter.

Properties

CandlesBuildFrom

Possible options for candles building.

public IEnumerable<Level1Fields> CandlesBuildFrom { get; }

Property Value

IEnumerable<Level1Fields>

Categories

Message adapter categories.

public virtual MessageAdapterCategories Categories { get; }

Property Value

MessageAdapterCategories

CheckTimeFrameByRequest

Check possible time-frame by request.

public bool CheckTimeFrameByRequest { get; }

Property Value

bool

CurrentTime

public DateTime CurrentTime { get; }

Property Value

DateTime

HeartbeatInterval

Server check interval for track the connection alive. The value is Zero turned off tracking.

public TimeSpan HeartbeatInterval { get; set; }

Property Value

TimeSpan

InnerAdapter

Underlying adapter.

public IMessageAdapter InnerAdapter { get; set; }

Property Value

IMessageAdapter

IsFullCandlesOnly

Translates CandleMessage as only fully filled.

public virtual bool IsFullCandlesOnly { get; }

Property Value

bool

IsNativeIdentifiers

Identify security in messages by native identifier Native.

public virtual bool IsNativeIdentifiers { get; }

Property Value

bool

IsNativeIdentifiersPersistable

Native identifier can be stored.

public virtual bool IsNativeIdentifiersPersistable { get; }

Property Value

bool

IsPositionsEmulationRequired

Adapter required emulation PositionChangeMessage.

public virtual bool? IsPositionsEmulationRequired { get; }

Property Value

bool?

Remarks

null means no emulatior, true by order balance, false by trades.

IsSecurityNewsOnly

Adapter provides news related with specified security.

public virtual bool IsSecurityNewsOnly { get; }

Property Value

bool

IsSupportExecutionsPnL

Adapter fills PnL.

public virtual bool IsSupportExecutionsPnL { get; }

Property Value

bool

IsSupportOrderBookIncrements

Adapter translates incremental order books.

public virtual bool IsSupportOrderBookIncrements { get; }

Property Value

bool

IsSupportSubscriptions

Support any subscriptions (ticks, order books etc.).

public virtual bool IsSupportSubscriptions { get; }

Property Value

bool

IsSupportTransactionLog

Adapter translates orders changes on reply of OrderStatusMessage.

public virtual bool IsSupportTransactionLog { get; }

Property Value

bool

NotSupportedResultMessages

Not supported by adapter result message types.

public virtual IEnumerable<MessageTypes> NotSupportedResultMessages { get; }

Property Value

IEnumerable<MessageTypes>

OwnInnerAdapter

Control InnerAdapter lifetime.

public bool OwnInnerAdapter { get; set; }

Property Value

bool

Parent

Parental logs source.

public virtual ILogSource Parent { get; set; }

Property Value

ILogSource

PossibleSupportedMessages

Possible supported by adapter message types.

public virtual IEnumerable<MessageTypeInfo> PossibleSupportedMessages { get; }

Property Value

IEnumerable<MessageTypeInfo>

ReConnectionSettings

Connection tracking settings IMessageAdapter with a server.

public ReConnectionSettings ReConnectionSettings { get; }

Property Value

ReConnectionSettings

SendInBackFurther

Auto send BackMode messages to InnerAdapter.

protected virtual bool SendInBackFurther { get; }

Property Value

bool

StorageName

The storage name, associated with the adapter.

public string StorageName { get; }

Property Value

string

SupportedInMessages

Supported by adapter message types.

public virtual IEnumerable<MessageTypes> SupportedInMessages { get; set; }

Property Value

IEnumerable<MessageTypes>

SupportedOrderBookDepths

Available options for MaxDepth.

public virtual IEnumerable<int> SupportedOrderBookDepths { get; }

Property Value

IEnumerable<int>

TransactionIdGenerator

Transaction id generator.

public IdGenerator TransactionIdGenerator { get; }

Property Value

IdGenerator

Methods

Dispose()

public virtual void Dispose()

GetSupportedMarketDataTypesAsync(SecurityId, DateTime?, DateTime?)

Get supported by adapter message types.

public virtual IAsyncEnumerable<DataType> GetSupportedMarketDataTypesAsync(SecurityId securityId, DateTime? from, DateTime? to)

Parameters

securityId SecurityId

SecurityId

from DateTime?

Start date for request. If null, then all available messages will be returned.

to DateTime?

End date for request. If null, then all available messages will be returned.

Returns

IAsyncEnumerable<DataType>

Supported by adapter market data types.

InnerAdapterNewOutMessageAsync(Message, CancellationToken)

Process InnerAdapter output message.

protected virtual ValueTask InnerAdapterNewOutMessageAsync(Message message, CancellationToken cancellationToken)

Parameters

message Message

The message.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

IsAllDownloadingSupported(DataType)

Is for the specified dataType all securities downloading enabled.

public virtual bool IsAllDownloadingSupported(DataType dataType)

Parameters

dataType DataType

Data type info.

Returns

bool

Check result.

IsSecurityRequired(DataType)

Support filtering subscriptions (subscribe/unsubscribe for specified security).

public virtual bool IsSecurityRequired(DataType dataType)

Parameters

dataType DataType

Data type info.

Returns

bool

Check result.

IsSupportCandlesPriceLevels(MarketDataMessage)

Support candles PriceLevels.

public virtual bool IsSupportCandlesPriceLevels(MarketDataMessage subscription)

Parameters

subscription MarketDataMessage

MarketDataMessage

Returns

bool

Check result.

IsSupportCandlesUpdates(MarketDataMessage)

Support candles subscription and live updates.

public virtual bool IsSupportCandlesUpdates(MarketDataMessage subscription)

Parameters

subscription MarketDataMessage

MarketDataMessage

Returns

bool

Check result.

Load(SettingsStorage)

Load settings.

public virtual void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

LogDebug(string, params object[])

To record a debug message to the log.

public void LogDebug(string message, params object[] args)

Parameters

message string

Text message.

args object[]

Text message settings. Used if a message is the format string. For details, see Format(string, params object[]).

LogError(string, params object[])

To record an error to the log.

public void LogError(string message, params object[] args)

Parameters

message string

Text message.

args object[]

Text message settings. Used if a message is the format string. For details, see Format(string, params object[]).

LogInfo(string, params object[])

To record a message to the log.

public void LogInfo(string message, params object[] args)

Parameters

message string

Text message.

args object[]

Text message settings. Used if a message is the format string. For details, see Format(string, params object[]).

LogVerbose(string, params object[])

To record a verbose message to the log.

public void LogVerbose(string message, params object[] args)

Parameters

message string

Text message.

args object[]

Text message settings. Used if a message is the format string. For details, see Format(string, params object[]).

LogWarning(string, params object[])

To record a warning to the log.

public void LogWarning(string message, params object[] args)

Parameters

message string

Text message.

args object[]

Text message settings. Used if a message is the format string. For details, see Format(string, params object[]).

OnInnerAdapterNewOutMessageAsync(Message, CancellationToken)

Process InnerAdapter output message.

protected virtual ValueTask OnInnerAdapterNewOutMessageAsync(Message message, CancellationToken cancellationToken)

Parameters

message Message

The message.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

OnSendInMessageAsync(Message, CancellationToken)

Send message.

protected virtual ValueTask OnSendInMessageAsync(Message message, CancellationToken cancellationToken)

Parameters

message Message

Message.

cancellationToken CancellationToken

CancellationToken

Returns

ValueTask

RaiseNewOutMessageAsync(Message, CancellationToken)

To call the event NewOutMessageAsync.

protected ValueTask RaiseNewOutMessageAsync(Message message, CancellationToken cancellationToken)

Parameters

message Message

The message.

cancellationToken CancellationToken

Cancellation token.

Returns

ValueTask

Save(SettingsStorage)

Save settings.

public virtual void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

SendInMessageAsync(Message, CancellationToken)

Processes a generic message asynchronously.

public virtual ValueTask SendInMessageAsync(Message message, CancellationToken cancellationToken)

Parameters

message Message

The message to process.

cancellationToken CancellationToken

CancellationToken

Returns

ValueTask

ToString()

public override string ToString()

Returns

string

Events

NewOutMessageAsync

New message event.

public event Func<Message, CancellationToken, ValueTask> NewOutMessageAsync

Event Type

Func<Message, CancellationToken, ValueTask>

ParentRemoved

Parent removed.

public event Action<ILogSource> ParentRemoved

Event Type

Action<ILogSource>