HistoryMarketDataManager
History market data manager implementation.
Inherits: Disposable
Implements: IHistoryMarketDataManager, IDisposable
Constructors
public HistoryMarketDataManager(ITradingTimeLineGenerator timeLineGenerator)
historyMarketDataManager = HistoryMarketDataManager(timeLineGenerator)
Initializes a new instance of the HistoryMarketDataManager.
- timeLineGenerator
- Trading time line generator.
Properties
public MarketDataStorageCache AdapterCache { get; set; }
value = historyMarketDataManager.AdapterCache
historyMarketDataManager.AdapterCache = value
MarketDataStorageCache.
public bool CheckTradableDates { get; set; }
value = historyMarketDataManager.CheckTradableDates
historyMarketDataManager.CheckTradableDates = value
Check loading dates are they tradable.
public DateTime CurrentTime { get; }
value = historyMarketDataManager.CurrentTime
Current time.
public IMarketDataDrive Drive { get; set; }
value = historyMarketDataManager.Drive
historyMarketDataManager.Drive = value
The storage which is used by default.
public bool IsStarted { get; private set; }
value = historyMarketDataManager.IsStarted
historyMarketDataManager.IsStarted = value
Is started.
public int LoadedMessageCount { get; private set; }
value = historyMarketDataManager.LoadedMessageCount
historyMarketDataManager.LoadedMessageCount = value
The number of loaded events.
public TimeSpan MarketTimeChangedInterval { get; set; }
value = historyMarketDataManager.MarketTimeChangedInterval
historyMarketDataManager.MarketTimeChangedInterval = value
The interval of message TimeMessage generation.
public int PostTradeMarketTimeChangedCount { get; set; }
value = historyMarketDataManager.PostTradeMarketTimeChangedCount
historyMarketDataManager.PostTradeMarketTimeChangedCount = value
The number of the event calls after end of trading.
public DateTime StartDate { get; set; }
value = historyMarketDataManager.StartDate
historyMarketDataManager.StartDate = value
Date in history for starting.
public DateTime StopDate { get; set; }
value = historyMarketDataManager.StopDate
historyMarketDataManager.StopDate = value
Date in history to stop (date is included).
public MarketDataStorageCache StorageCache { get; set; }
value = historyMarketDataManager.StorageCache
historyMarketDataManager.StorageCache = value
Cache.
public StorageFormats StorageFormat { get; set; }
value = historyMarketDataManager.StorageFormat
historyMarketDataManager.StorageFormat = value
The format of market data.
public IStorageRegistry StorageRegistry { get; set; }
value = historyMarketDataManager.StorageRegistry
historyMarketDataManager.StorageRegistry = value
Market data storage.
Methods
protected override void DisposeManaged()
historyMarketDataManager.DisposeManaged()
Release resources.
private IEnumerable<Message> DriveGenerators(Message trigger, DateTime time)
result = historyMarketDataManager.DriveGenerators(trigger, time)
Drives the registered generators with the replay clock and same-security data, returning any generated messages (interleaved by the caller at the same server time). A time signal advances time-based generation for every generator; the triggering message feeds the generators of its own security, and each generated message is chained into the other same-security generators, so a generated tick drives that security's order-book generator. Generators ignore their own output type, so the chain terminates.
- trigger
- The replayed message that advanced the clock.
- time
- The current replay server time.
Returns: The generated messages, if any.
public IAsyncEnumerable<DataType> GetSupportedDataTypesAsync(SecurityId securityId)
result = historyMarketDataManager.GetSupportedDataTypesAsync(securityId)
Get supported data types for security.
- securityId
- Security ID.
Returns: Supported data types.
public bool HasGenerator(SecurityId securityId, DataType dataType)
result = historyMarketDataManager.HasGenerator(securityId, dataType)
Check if generator exists.
- securityId
- Security ID.
- dataType
- Data type.
Returns: if generator exists.
public void RegisterGenerator(SecurityId securityId, DataType dataType, MarketDataGenerator generator, long transactionId)
historyMarketDataManager.RegisterGenerator(securityId, dataType, generator, transactionId)
Register generator.
- securityId
- Security ID.
- dataType
- Data type.
- generator
- Generator.
- transactionId
- Transaction ID.
public IAsyncEnumerable<Message> StartAsync(IEnumerable<BoardMessage> boards)
result = historyMarketDataManager.StartAsync(boards)
Start market data generation.
- boards
- Exchange boards.
Returns: Async enumerable of messages.
public ValueTask<Exception> SubscribeAsync(MarketDataMessage message, CancellationToken cancellationToken)
result = historyMarketDataManager.SubscribeAsync(message, cancellationToken)
Subscribe to market data.
- message
- Subscription message.
- cancellationToken
- Cancellation token.
Returns: Error if subscription failed, null otherwise.
public bool UnregisterGenerator(long originalTransactionId)
result = historyMarketDataManager.UnregisterGenerator(originalTransactionId)
Unregister generator.
- originalTransactionId
- Original transaction id.
Returns: if generator was found and removed.
public void Unsubscribe(long originalTransactionId)
historyMarketDataManager.Unsubscribe(originalTransactionId)
Unsubscribe from market data.
- originalTransactionId
- Original subscription transaction id.