Table of Contents

Class HistoryMessageAdapter

Namespace
StockSharp.Algo.Testing
Assembly
StockSharp.Algo.dll

The adapter, receiving messages form the storage IStorageRegistry.

public class HistoryMessageAdapter : MessageAdapter, IMessageAdapter, IMessageChannel, ICloneable<IMessageChannel>, ICloneable, IPersistable, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanged
Inheritance
HistoryMessageAdapter
Implements
ICloneable<IMessageChannel>
IPersistable
Inherited Members
Extension Methods

Constructors

HistoryMessageAdapter(IdGenerator, ISecurityProvider)

Initializes a new instance of the HistoryMessageAdapter.

public HistoryMessageAdapter(IdGenerator transactionIdGenerator, ISecurityProvider securityProvider)

Parameters

transactionIdGenerator IdGenerator

Transaction id generator.

securityProvider ISecurityProvider

The provider of information about instruments.

Properties

AdapterCache

public MarketDataStorageCache AdapterCache { get; set; }

Property Value

MarketDataStorageCache

CheckTradableDates

Check loading dates are they tradable.

public bool CheckTradableDates { get; set; }

Property Value

bool

CurrentTime

Current time, which will be passed to the Time.

public override DateTimeOffset CurrentTime { get; }

Property Value

DateTimeOffset

Drive

The storage which is used by default. By default, DefaultDrive is used.

public IMarketDataDrive Drive { get; set; }

Property Value

IMarketDataDrive

IsFullCandlesOnly

Translates CandleMessage as only fully filled.

public override bool IsFullCandlesOnly { get; }

Property Value

bool

LoadedMessageCount

The number of loaded events.

public int LoadedMessageCount { get; }

Property Value

int

MarketTimeChangedInterval

The interval of message TimeMessage generation. By default, it is equal to 1 sec.

public TimeSpan MarketTimeChangedInterval { get; set; }

Property Value

TimeSpan

OrderLogMarketDepthBuilders

Order book builders.

public IDictionary<SecurityId, IOrderLogMarketDepthBuilder> OrderLogMarketDepthBuilders { get; }

Property Value

IDictionary<SecurityId, IOrderLogMarketDepthBuilder>

PostTradeMarketTimeChangedCount

The number of the event MarketTimeChanged calls after end of trading. By default it is equal to 2.

public int PostTradeMarketTimeChangedCount { get; set; }

Property Value

int

Remarks

It is required for activation of post-trade rules (rules, basing on events, occurring after end of trading).

SecurityProvider

The provider of information about instruments.

public ISecurityProvider SecurityProvider { get; }

Property Value

ISecurityProvider

StartDate

Date in history for starting the paper trading.

public DateTimeOffset StartDate { get; set; }

Property Value

DateTimeOffset

StopDate

Date in history to stop the paper trading (date is included).

public DateTimeOffset StopDate { get; set; }

Property Value

DateTimeOffset

StorageCache

public MarketDataStorageCache StorageCache { get; set; }

Property Value

MarketDataStorageCache

StorageFormat

The format of market data. Binary is used by default.

public StorageFormats StorageFormat { get; set; }

Property Value

StorageFormats

StorageRegistry

Market data storage.

public IStorageRegistry StorageRegistry { get; set; }

Property Value

IStorageRegistry

SupportedMarketDataTypes

Supported by adapter market data types.

public override IEnumerable<DataType> SupportedMarketDataTypes { get; }

Property Value

IEnumerable<DataType>

Methods

CreateOrderLogMarketDepthBuilder(SecurityId)

Create market depth builder.

public override IOrderLogMarketDepthBuilder CreateOrderLogMarketDepthBuilder(SecurityId securityId)

Parameters

securityId SecurityId

Security ID.

Returns

IOrderLogMarketDepthBuilder

Order log to market depth builder.

DisposeManaged()

Release resources.

protected override void DisposeManaged()

GetCandleArgs(Type, SecurityId, DateTimeOffset?, DateTimeOffset?)

Get possible args for the specified candle type and instrument.

public override IEnumerable<object> GetCandleArgs(Type candleType, SecurityId securityId, DateTimeOffset? from, DateTimeOffset? to)

Parameters

candleType Type

The type of the message CandleMessage.

securityId SecurityId

Security ID.

from DateTimeOffset?

The initial date from which you need to get data.

to DateTimeOffset?

The final date by which you need to get data.

Returns

IEnumerable<object>

Possible args.

GetSupportedDataTypes(SecurityId)

Get supported data types for the specified SecurityId.

public override IEnumerable<DataType> GetSupportedDataTypes(SecurityId securityId)

Parameters

securityId SecurityId

SecurityId

Returns

IEnumerable<DataType>

Supported data types.

IsAllDownloadingSupported(DataType)

Is for the specified dataType all securities downloading enabled.

public override bool IsAllDownloadingSupported(DataType dataType)

Parameters

dataType DataType

Data type info.

Returns

bool

Check result.

IsSupportCandlesUpdates(MarketDataMessage)

Support candles subscription and live updates.

public override bool IsSupportCandlesUpdates(MarketDataMessage subscription)

Parameters

subscription MarketDataMessage

MarketDataMessage

Returns

bool

Check result.

OnSendInMessage(Message)

Send message.

protected override bool OnSendInMessage(Message message)

Parameters

message Message

Message.

Returns

bool

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

SendOutMessage(Message)

Send outgoing message and raise NewOutMessage event.

protected override void SendOutMessage(Message message)

Parameters

message Message

Message.

ToString()

public override string ToString()

Returns

string