EmulationMessageAdapter

StockSharp.Algo.Testing

Emulation message adapter.

Inherits: MessageAdapterWrapper

Implements: IEmulationMessageAdapter, IMessageAdapter, IMessageTransport, IAsyncPersistable, ILogReceiver, ILogSource, IDisposable

Constructors

EmulationMessageAdapter
public EmulationMessageAdapter(IMessageAdapter innerAdapter, IMessageChannel inChannel, bool isEmulationOnly, ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IExchangeInfoProvider exchangeInfoProvider)
emulationMessageAdapter = EmulationMessageAdapter(innerAdapter, inChannel, isEmulationOnly, securityProvider, portfolioProvider, exchangeInfoProvider)

Initialize EmulationMessageAdapter.

innerAdapter
Underlying adapter.
inChannel
Incoming messages channel.
isEmulationOnly
All messages do not contains real trading.
securityProvider
The provider of information about instruments.
portfolioProvider
The portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProvider
Exchanges and trading boards provider.

Properties

Emulator
public IMarketEmulator Emulator { get; }
value = emulationMessageAdapter.Emulator

Emulator.

InChannel
public IMessageChannel InChannel { get; }
value = emulationMessageAdapter.InChannel

Incoming messages channel.

IsPositionsEmulationRequired
public override bool? IsPositionsEmulationRequired { get; }
value = emulationMessageAdapter.IsPositionsEmulationRequired

Adapter required emulation PositionChangeMessage.

IsSupportTransactionLog
public override bool IsSupportTransactionLog { get; }
value = emulationMessageAdapter.IsSupportTransactionLog

Adapter translates orders changes on reply of OrderStatusMessage.

Settings
public MarketEmulatorSettings Settings { get; }
value = emulationMessageAdapter.Settings

Settings of exchange emulator.

SupportedInMessages
public override IEnumerable<MessageTypes> SupportedInMessages { get; }
value = emulationMessageAdapter.SupportedInMessages

Supported by adapter message types.

Methods

CloneAsync
public override ValueTask<IMessageAdapter> CloneAsync(CancellationToken cancellationToken)
result = emulationMessageAdapter.CloneAsync(cancellationToken)

Create a copy of EmulationMessageAdapter.

cancellationToken
CancellationToken

Returns: Copy.

Dispose
public override void Dispose()
emulationMessageAdapter.Dispose()

Disposes of items in the pool that implement IDisposable.

InnerAdapterNewOutMessageAsync
protected override ValueTask InnerAdapterNewOutMessageAsync(Message message, CancellationToken cancellationToken)
result = emulationMessageAdapter.InnerAdapterNewOutMessageAsync(message, cancellationToken)

Process InnerAdapter output message.

message
The message.
cancellationToken
Cancellation token.
LoadAsync
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = emulationMessageAdapter.LoadAsync(storage, cancellationToken)

Load settings.

storage
Settings storage.
cancellationToken
CancellationToken

Returns: Task

OnInnerAdapterNewOutMessageAsync
protected override ValueTask OnInnerAdapterNewOutMessageAsync(Message message, CancellationToken cancellationToken)
result = emulationMessageAdapter.OnInnerAdapterNewOutMessageAsync(message, cancellationToken)

Process InnerAdapter output message.

message
The message.
cancellationToken
Cancellation token.
OnSendInMessageAsync
protected override ValueTask OnSendInMessageAsync(Message message, CancellationToken cancellationToken)
result = emulationMessageAdapter.OnSendInMessageAsync(message, cancellationToken)

Send message.

message
Message.
cancellationToken
CancellationToken
SaveAsync
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = emulationMessageAdapter.SaveAsync(storage, cancellationToken)

Save settings.

storage
Settings storage.
cancellationToken
CancellationToken

Returns: Task