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
IdGeneratorTransaction id generator.
securityProvider
ISecurityProviderThe provider of information about instruments.
Properties
AdapterCache
public MarketDataStorageCache AdapterCache { get; set; }
Property Value
CheckTradableDates
Check loading dates are they tradable.
public bool CheckTradableDates { get; set; }
Property Value
CurrentTime
Current time, which will be passed to the Time.
public override DateTimeOffset CurrentTime { get; }
Property Value
Drive
The storage which is used by default. By default, DefaultDrive is used.
public IMarketDataDrive Drive { get; set; }
Property Value
IsFullCandlesOnly
Translates CandleMessage as only fully filled.
public override bool IsFullCandlesOnly { get; }
Property Value
LoadedMessageCount
The number of loaded events.
public int LoadedMessageCount { get; }
Property Value
MarketTimeChangedInterval
The interval of message TimeMessage generation. By default, it is equal to 1 sec.
public TimeSpan MarketTimeChangedInterval { get; set; }
Property Value
OrderLogMarketDepthBuilders
Order book builders.
public IDictionary<SecurityId, IOrderLogMarketDepthBuilder> OrderLogMarketDepthBuilders { get; }
Property Value
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
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
StartDate
Date in history for starting the paper trading.
public DateTimeOffset StartDate { get; set; }
Property Value
StopDate
Date in history to stop the paper trading (date is included).
public DateTimeOffset StopDate { get; set; }
Property Value
StorageCache
public MarketDataStorageCache StorageCache { get; set; }
Property Value
StorageFormat
The format of market data. Binary is used by default.
public StorageFormats StorageFormat { get; set; }
Property Value
StorageRegistry
Market data storage.
public IStorageRegistry StorageRegistry { get; set; }
Property Value
SupportedMarketDataTypes
Supported by adapter market data types.
public override IEnumerable<DataType> SupportedMarketDataTypes { get; }
Property Value
Methods
CreateOrderLogMarketDepthBuilder(SecurityId)
Create market depth builder.
public override IOrderLogMarketDepthBuilder CreateOrderLogMarketDepthBuilder(SecurityId securityId)
Parameters
securityId
SecurityIdSecurity 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
TypeThe type of the message CandleMessage.
securityId
SecurityIdSecurity 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
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
DataTypeData type info.
Returns
- bool
Check result.
IsSupportCandlesUpdates(MarketDataMessage)
Support candles subscription and live updates.
public override bool IsSupportCandlesUpdates(MarketDataMessage subscription)
Parameters
subscription
MarketDataMessage
Returns
- bool
Check result.
OnSendInMessage(Message)
Send message.
protected override bool OnSendInMessage(Message message)
Parameters
message
MessageMessage.
Returns
SendOutMessage(Message)
Send outgoing message and raise NewOutMessage event.
protected override void SendOutMessage(Message message)
Parameters
message
MessageMessage.
ToString()
public override string ToString()