dxFeed .Net API  5.8.0
dxFeed .Net API library intended to provide market data access for DX clients
com.dxfeed.api.events.IDxTimeSeriesEvent Interface Reference

Represents time-series snapshots of some process that is evolving in time or actual events in some external system that have an associated time stamp and can be uniquely identified. For example, IDxTimeAndSale events represent the actual sales that happen on a market exchange at specific time moments, while IDxCandle events represent snapshots of aggregate information about trading over a specific time period. More...

Inheritance diagram for com.dxfeed.api.events.IDxTimeSeriesEvent:
[legend]

Detailed Description

Represents time-series snapshots of some process that is evolving in time or actual events in some external system that have an associated time stamp and can be uniquely identified. For example, IDxTimeAndSale events represent the actual sales that happen on a market exchange at specific time moments, while IDxCandle events represent snapshots of aggregate information about trading over a specific time period.

Time-series events can be used with IDXFeedTimeSeriesSubscription<E> to receive a time-series history of past events. Time-series events are conflated based on unique IDxIndexedEvent.Index for each symbol. Last indexed event for each symbol and index is always delivered to event listeners on subscription, but intermediate (next-to-last) events for each symbol+index pair are not queued anywhere, they are simply discarded as stale events.

Timestamp of an event is available via IDxTimeSeriesEvent.TimeStamp property with a millisecond precision. Some events may happen multiple times per millisecond. In this case they have the same IDxTimeSeriesEvent.TimeStamp, but different IDxIndexedEvent.Index. An ordering of IDxIndexedEvent.Index is the same as an ordering of IDxTimeSeriesEvent.TimeStamp. That is, an collection of time-series events that is ordered by IDxIndexedEvent.Index is ascending order will be also ordered by IDxTimeSeriesEvent.TimeStamp in ascending order.

Time-series events are a more specific subtype of IDxIndexedEvent. All general documentation and Event Flags section, in particular, applies to time-series events. However, the time-series events never come from multiple sources for the same symbol and their IDxIndexedEvent.Source is always IndexedEventSource.DEFAULT.

Unlike a general IDxIndexedEvent that is subscribed to via IDXFeedSubscription<E> using a plain symbol to receive all events for all indices, time-series events are typically subscribed to using TimeSeriesSubscriptionSymbol class to specific time range of the subscription. There is a dedicated IDXFeedTimeSeriesSubscription<E> class that is designed to simplify the task of subscribing for time-series events.

TimeSeriesEventModel class handles all the snapshot and transaction logic and conveniently represents a list of current time-series events ordered by their IDxTimeSeriesEvent.TimeStamp. It relies on the code of AbstractIndexedEventMode to handle this logic. Use the source code of AbstractIndexedEventModel for clarification on transactions and snapshot logic.

Classes that implement this interface may also implement IDxLastingEvent interface, which makes it possible to use DXFeed.GetLastEventPromise method to retrieve the last event for the corresponding symbol.

Publishing time-series

When publishing time-series event with DXPublisher::publishEvents(Collection) method on incoming TimeSeriesSubscriptionSymbol the snapshot of currently known events for the requested time range has to be published first.

A snapshot is published in the descending order of IDxIndexedEvent.Index (which is the same as the descending order of IDxTimeSeriesEvent.TimeStamp), starting with an event with the largest index and marking it with EventFlag.SnapshotBegin bit in IDxIndexedEvent.EventFlags. All other event follow with default, zero IDxIndexedEvent.EventFlags. If there is no actual event at the time that was specified in subscription IDXFeedTimeSeriesSubscription<E>.FromTimeStamp property, then event with the corresponding time has to be created anyway and published. To distinguish it from the actual event, it has to be marked with EventFlag.RemoveEvent bit in IDxIndexedEvent.EventFlags. EventFlag.SnapshotEnd bit in this event's IDxIndexedEvent.EventFlags is optional during publishing. It will be properly set on receiving end anyway. Note, that publishing any event with time that is below subscription IDXFeedTimeSeriesSubscription<E>.FromTimeStamp also works as a legal indicator for the end of the snapshot.

Both IDxTimeAndSale and IDxCandle time-series events define a sequence property that is mixed into an IDxIndexedEvent.Index property. It provides a way to distinguish different events at the same time. For a snapshot end event the sequence has to be left at its default zero value. It means, that if there is an actual event to be published at subscription IDXFeedTimeSeriesSubscription<E>.FromTimeStamp with non-zero sequence, then generation of an additional snapshot end event with the subscription IDXFeedTimeSeriesSubscription<E>.FromTimeStamp and zero sequence is still required.


The documentation for this interface was generated from the following file: