Table of Contents

Class BasketMessageAdapter

Namespace
StockSharp.Algo
Assembly
StockSharp.Algo.dll

Adapter-aggregator that allows simultaneously to operate multiple adapters connected to different trading systems.

[Display(ResourceType = typeof(LocalizedStrings), Name = "Basket")]
public class BasketMessageAdapter : BaseLogReceiver, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable
Inheritance
BasketMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Inherited Members
Extension Methods

Constructors

BasketMessageAdapter(IdGenerator, CandleBuilderProvider)

Initializes a new instance of the BasketMessageAdapter.

public BasketMessageAdapter(IdGenerator transactionIdGenerator, CandleBuilderProvider candleBuilderProvider)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

candleBuilderProvider CandleBuilderProvider

Candle builders provider.

BasketMessageAdapter(IdGenerator, CandleBuilderProvider, ISecurityMessageAdapterProvider, IPortfolioMessageAdapterProvider)

Initializes a new instance of the BasketMessageAdapter.

public BasketMessageAdapter(IdGenerator transactionIdGenerator, CandleBuilderProvider candleBuilderProvider, ISecurityMessageAdapterProvider securityAdapterProvider, IPortfolioMessageAdapterProvider portfolioAdapterProvider)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

candleBuilderProvider CandleBuilderProvider

Candle builders provider.

securityAdapterProvider ISecurityMessageAdapterProvider

The security based message adapter's provider.

portfolioAdapterProvider IPortfolioMessageAdapterProvider

The portfolio based message adapter's provider.

Properties

CommissionManager

The commission calculating manager.

public ICommissionManager CommissionManager { get; set; }

Property Value

ICommissionManager

ConnectDisconnectEventOnFirstAdapter

To call the ConnectMessage event when the first adapter connects to InnerAdapters.

public bool ConnectDisconnectEventOnFirstAdapter { get; set; }

Property Value

bool

ExtendedInfoStorage

Extended info storage.

public IExtendedInfoStorage ExtendedInfoStorage { get; set; }

Property Value

IExtendedInfoStorage

FillGapsBehaviour

public IFillGapsBehaviour FillGapsBehaviour { get; set; }

Property Value

IFillGapsBehaviour

IgnoreExtraAdapters

Do not add extra adapters.

public bool IgnoreExtraAdapters { get; set; }

Property Value

bool

InnerAdapters

Adapters with which the aggregator operates.

public IInnerAdapterList InnerAdapters { get; }

Property Value

IInnerAdapterList

IsRestoreSubscriptionOnErrorReconnect

Restore subscription on reconnect.

public bool IsRestoreSubscriptionOnErrorReconnect { get; set; }

Property Value

bool

Remarks

Error case like connection lost etc.

IsSecurityNewsOnly

Adapter provides news related with specified security.

public bool IsSecurityNewsOnly { get; }

Property Value

bool

IsSupportPositionEmulation

public bool IsSupportPositionEmulation { get; set; }

Property Value

bool

IsSupportTransactionLog

public bool IsSupportTransactionLog { get; set; }

Property Value

bool

LatencyManager

Orders registration delay calculation manager.

public ILatencyManager LatencyManager { get; set; }

Property Value

ILatencyManager

Level1Extend

public bool Level1Extend { get; set; }

Property Value

bool

NativeIdStorage

Security native identifier storage.

public INativeIdStorage NativeIdStorage { get; set; }

Property Value

INativeIdStorage

PnLManager

The profit-loss manager.

public IPnLManager PnLManager { get; set; }

Property Value

IPnLManager

PortfolioAdapterProvider

The portfolio based message adapter's provider.

public IPortfolioMessageAdapterProvider PortfolioAdapterProvider { get; }

Property Value

IPortfolioMessageAdapterProvider

SecurityAdapterProvider

The security based message adapter's provider.

public ISecurityMessageAdapterProvider SecurityAdapterProvider { get; }

Property Value

ISecurityMessageAdapterProvider

SecurityMappingStorage

Security identifier mappings storage.

public ISecurityMappingStorage SecurityMappingStorage { get; set; }

Property Value

ISecurityMappingStorage

SendFinishedCandlesImmediatelly

public bool SendFinishedCandlesImmediatelly { get; set; }

Property Value

bool

SlippageManager

Slippage manager.

public ISlippageManager SlippageManager { get; set; }

Property Value

ISlippageManager

StorageProcessor

Storage processor.

public StorageProcessor StorageProcessor { get; }

Property Value

StorageProcessor

StorageSettings

Storage settings.

public StorageCoreSettings StorageSettings { get; }

Property Value

StorageCoreSettings

SupportBuildingFromOrderLog

public bool SupportBuildingFromOrderLog { get; set; }

Property Value

bool

SupportCandlesCompression

public bool SupportCandlesCompression { get; set; }

Property Value

bool

SupportLookupTracking

public bool SupportLookupTracking { get; set; }

Property Value

bool

SupportOffline

public bool SupportOffline { get; set; }

Property Value

bool

SupportOrderBookTruncate

public bool SupportOrderBookTruncate { get; set; }

Property Value

bool

SupportPartialDownload

public bool SupportPartialDownload { get; set; }

Property Value

bool

SupportSecurityAll

public bool SupportSecurityAll { get; set; }

Property Value

bool

SupportStorage

public bool SupportStorage { get; set; }

Property Value

bool

SuppressReconnectingErrors

Suppress reconnecting errors.

public bool SuppressReconnectingErrors { get; set; }

Property Value

bool

TransactionIdGenerator

Transaction id generator.

public IdGenerator TransactionIdGenerator { get; set; }

Property Value

IdGenerator

UseChannels

Use channels for in and out messages.

public bool UseChannels { get; set; }

Property Value

bool

Methods

ApplyHeartbeat(IMessageAdapter, bool)

Apply on/off heartbeat mode for the specified adapter.

public void ApplyHeartbeat(IMessageAdapter adapter, bool on)

Parameters

adapter IMessageAdapter

Adapter.

on bool

Is active.

Clone()

Create a copy of BasketMessageAdapter.

public IMessageChannel Clone()

Returns

IMessageChannel

Copy.

DisposeManaged()

To release allocated resources.

protected override void DisposeManaged()

GetSortedAdapters()

To get adapters SortedAdapters sorted by the specified priority. By default, there is no sorting.

protected IEnumerable<IMessageAdapter> GetSortedAdapters()

Returns

IEnumerable<IMessageAdapter>

Sorted adapters.

Load(SettingsStorage)

Load settings.

public override void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnInnerAdapterNewOutMessage(IMessageAdapter, Message)

The embedded adapter event NewOutMessage handler.

protected virtual void OnInnerAdapterNewOutMessage(IMessageAdapter innerAdapter, Message message)

Parameters

innerAdapter IMessageAdapter

The embedded adapter.

message Message

Message.

OnSendInMessage(Message)

Send message.

protected virtual bool OnSendInMessage(Message message)

Parameters

message Message

Message.

Returns

bool

true if the specified message was processed successfully, otherwise, false.

OnSendOutMessage(Message)

Send outgoing message and raise NewOutMessage event.

protected virtual void OnSendOutMessage(Message message)

Parameters

message Message

Message.

Save(SettingsStorage)

Save settings.

public override void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

TryGetAdapter(string, out IMessageAdapter)

Try find adapter by portfolio name.

public bool TryGetAdapter(string porfolioName, out IMessageAdapter adapter)

Parameters

porfolioName string

Portfolio name.

adapter IMessageAdapter

IMessageAdapter

Returns

bool

Found IMessageAdapter.

Events

NewOutMessage

New message event.

public event Action<Message> NewOutMessage

Event Type

Action<Message>