dxFeed .Net API
7.1.0
dxFeed .Net API library intended to provide market data access for DX clients
|
Main entry class for dxFeed API (read it first). More...
Public Member Functions | |
IDXFeedSubscription< E > | CreateSubscription< E > () |
Creates new subscription for a single event type that is attached to this feed. For multiple event types in one subscription use CreateSubscription<E>(Type[]). This method creates new IDXFeedSubscription<E>. More... | |
IDXFeedSubscription< E > | CreateSubscription< E > (params Type[] eventTypes) |
Creates new subscription for multiple event types that is attached to this feed. For a single event type use CreateSubscription<E>. This method creates new IDXFeedSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>). More... | |
IDXFeedTimeSeriesSubscription< E > | CreateTimeSeriesSubscription< E > () |
Creates new time series subscription for a single event type that is attached to this feed. For multiple event types in one subscription use CreateTimeSeriesSubscription<E>(Type[]). This method creates new IDXFeedTimeSeriesSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>). More... | |
IDXFeedTimeSeriesSubscription< E > | CreateTimeSeriesSubscription< E > (params Type[] eventTypes) |
Creates new time series subscription for multiple event types that is attached to this feed. For a single event type use CreateTimeSeriesSubscription<E>. This method creates new IDXFeedTimeSeriesSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>). More... | |
void | AttachSubscription< E > (IDXFeedSubscription< E > subscription) |
void | DetachSubscription< E > (IDXFeedSubscription< E > subscription) |
Detaches the given subscription from this feed. This method does nothing if the corresponding subscription is not attached to this feed. More... | |
Task< IDxLastingEvent > | GetLastEventPromise< E > (object symbol, CancellationToken cancellationToken) |
Requests the last event for the specified event type and symbol. This method works only for event types that implement IDxLastingEvent marker interface. This method requests the data from the the uplink data provider, creates new event of the specified event type E , and completes the resulting promise with this event. More... | |
List< Task< IDxLastingEvent > > | GetLastEventsPromises< E > (ICollection< object > symbols, CancellationToken cancellationToken) |
Requests the last events for the specified event type and a collection of symbols. This method works only for event types that implement IDxLastingEvent marker interface. This method requests the data from the the uplink data provider, creates new events of the specified event type E , and completes the resulting promises with these events. More... | |
Task< List< E > > | GetIndexedEventsPromise< E > (object symbol, IndexedEventSource source, CancellationToken cancellationToken) |
Requests a list of indexed events for the specified event type, symbol, and source. This method works only for event types that implement IDxIndexedEvent interface. This method requests the data from the the uplink data provider, creates a list of events of the specified event type E , and completes the resulting promise with this list. The events are ordered by IDxIndexedEvent.Index in the list. More... | |
Task< List< E > > | GetTimeSeriesPromise< E > (object symbol, long fromTime, long toTime, CancellationToken cancellationToken) |
Requests time series of events for the specified event type, symbol, and a range of time. This method works only for event types that implement IDxTimeSeriesEvent interface. This method requests the data from the the uplink data provider, creates a list of events of the specified event type E , and completes the resulting promise with this list. The events are ordered by IDxTimeSeriesEvent.Time in the list. More... | |
Main entry class for dxFeed API (read it first).
void com.dxfeed.api.IDXFeed.AttachSubscription< E > | ( | IDXFeedSubscription< E > | subscription | ) |
Attaches the given subscription to this feed. This method does nothing if the corresponding subscription is already attached to this feed.
This feed publishes data to the attached subscription. Application can attach IDXFeedEventListener<E> via IDXFeedSubscription<E>.AddEventListener(IDXFeedEventListener<E>) to get notified about data changes and can change its data subscription via IDXFeedSubscription<E> methods.
E | The type of events. |
subscription | The subscription. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxEventType |
IDXFeedSubscription<E> com.dxfeed.api.IDXFeed.CreateSubscription< E > | ( | ) |
Creates new subscription for a single event type that is attached to this feed. For multiple event types in one subscription use CreateSubscription<E>(Type[]). This method creates new IDXFeedSubscription<E>.
E | The type of events. |
InvalidOperationException | Endpoint was been closed. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxEventType |
IDXFeedSubscription<E> com.dxfeed.api.IDXFeed.CreateSubscription< E > | ( | params Type [] | eventTypes | ) |
Creates new subscription for multiple event types that is attached to this feed. For a single event type use CreateSubscription<E>. This method creates new IDXFeedSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>).
E | The type of events. |
eventTypes | The classes of event types. |
InvalidOperationException | Endpoint was been closed. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxEventType |
IDXFeedTimeSeriesSubscription<E> com.dxfeed.api.IDXFeed.CreateTimeSeriesSubscription< E > | ( | params Type [] | eventTypes | ) |
Creates new time series subscription for multiple event types that is attached to this feed. For a single event type use CreateTimeSeriesSubscription<E>. This method creates new IDXFeedTimeSeriesSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>).
E | The base type of events. |
eventTypes | The classes of event types. |
InvalidOperationException | Endpoint was been closed. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxTimeSeriesEvent |
IDXFeedTimeSeriesSubscription<E> com.dxfeed.api.IDXFeed.CreateTimeSeriesSubscription< E > | ( | ) |
Creates new time series subscription for a single event type that is attached to this feed. For multiple event types in one subscription use CreateTimeSeriesSubscription<E>(Type[]). This method creates new IDXFeedTimeSeriesSubscription<E> and invokes AttachSubscription<E>(IDXFeedSubscription<E>).
E | The type of event. |
InvalidOperationException | Endpoint was been closed. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxTimeSeriesEvent |
void com.dxfeed.api.IDXFeed.DetachSubscription< E > | ( | IDXFeedSubscription< E > | subscription | ) |
Detaches the given subscription from this feed. This method does nothing if the corresponding subscription is not attached to this feed.
subscription | The subscription. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxEventType |
Task<List<E> > com.dxfeed.api.IDXFeed.GetIndexedEventsPromise< E > | ( | object | symbol, |
IndexedEventSource | source, | ||
CancellationToken | cancellationToken | ||
) |
Requests a list of indexed events for the specified event type, symbol, and source. This method works only for event types that implement IDxIndexedEvent interface. This method requests the data from the the uplink data provider, creates a list of events of the specified event type E
, and completes the resulting promise with this list. The events are ordered by IDxIndexedEvent.Index in the list.
This method is designed for retrieval of a snapshot only. Use IDxConnection.CreateSnapshotSubscription(EventType, long, IDxSnapshotListener) if you need a list of time-series events that updates in real time.
The promise is TaskStatus.Canceled when the the underlying DXEndpoint is DXEndpoint.Close(). If the event is not available for any transient reason (no subscription, no connection to uplink, etc), then the resulting promise completes when the issue is resolved, which may involve an arbitrarily long wait. Use CancellationTokenSource class constructors and methods to specify timeout while waiting for promise to complete. If the event is permanently not available (not supported), then the promise completes exceptionally with AggregateException.
Note, that this method does not work when DXEndpoint was created with DXEndpoint.Role::STREAM_FEED role (promise completes exceptionally).
Event source
Use the IndexedEventSource.DEFAULT value for source
with events that do not have multiple sources (like IDxSeries). For events with multiple sources (like IDxOrder and IDxSpreadOrder), use an even-specific source class (for example, OrderSource). This method does not support synthetic sources of orders (orders that are automatically generated from IDxQuote events).
Event flags and consistent snapshot
This method completes promise only when a consistent snapshot of time series has been received from the data feed. The IDxIndexedEvent.EventFlags property of the events in the resulting list is always zero.
Threads
Use Task.ContinueWith(Action<Task>) method on the resulting promise to receive notification when the promise becomes done.
E | The event type. |
symbol | The collection of symbols. |
source | The source. |
cancellationToken | The task cancellation token. |
ArgumentException | The symbol symbol is not one of string or CandleSymbol. |
ArgumentNullException | The symbol or source is null. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxIndexedEvent |
Task<IDxLastingEvent> com.dxfeed.api.IDXFeed.GetLastEventPromise< E > | ( | object | symbol, |
CancellationToken | cancellationToken | ||
) |
Requests the last event for the specified event type and symbol. This method works only for event types that implement IDxLastingEvent marker interface. This method requests the data from the the uplink data provider, creates new event of the specified event type E
, and completes the resulting promise with this event.
This method is designed for retrieval of a snapshot only. Use DXFeedSubscription<E> if you need event updates in real time.
The promise is TaskStatus.Canceled when the the underlying DXEndpoint is DXEndpoint.Close(). If the event is not available for any transient reason (no subscription, no connection to uplink, etc), then the resulting promise completes when the issue is resolved, which may involve an arbitrarily long wait. Use CancellationTokenSource class constructors and methods to specify timeout while waiting for promise to complete. If the event is permanently not available (not supported), then the promise completes exceptionally with AggregateException.
There is a bulk version of this method that works much faster for a single event type and multiple symbols. See GetLastEventsPromises<E>(ICollection<object>, CancellationToken).
Note, that this method does not work when DXEndpoint was created with DXEndpoint.Role::STREAM_FEED role (promise completes exceptionally).
Threads
Use Task.ContinueWith(Action<Task>) method on the resulting promise to receive notification when the promise becomes done.
Use the following pattern of code to acquire multiple events (either for multiple symbols and/or multiple events) and wait with a single timeout for all of them:
E | The event type. |
symbol | The symbol. |
cancellationToken | The task cancellation token. |
ArgumentException | The symbol symbol is not one of string or CandleSymbol. |
ArgumentNullException | The symbol is null. |
Implemented in com.dxfeed.api.DXFeed.
E | : | class | |
E | : | IDxLastingEvent |
List<Task<IDxLastingEvent> > com.dxfeed.api.IDXFeed.GetLastEventsPromises< E > | ( | ICollection< object > | symbols, |
CancellationToken | cancellationToken | ||
) |
Requests the last events for the specified event type and a collection of symbols. This method works only for event types that implement IDxLastingEvent marker interface. This method requests the data from the the uplink data provider, creates new events of the specified event type E
, and completes the resulting promises with these events.
This is a bulk version of GetLastEventPromise<E>(object, CancellationToken) method.
The promise is TaskStatus.Canceled when the the underlying DXEndpoint is DXEndpoint.Close(). If the event is not available for any transient reason (no subscription, no connection to uplink, etc), then the resulting promise completes when the issue is resolved, which may involve an arbitrarily long wait. Use CancellationTokenSource class constructors and methods to specify timeout while waiting for promise to complete. If the event is permanently not available (not supported), then the promise completes exceptionally with AggregateException.
Note, that this method does not work when DXEndpoint was created with DXEndpoint.Role::STREAM_FEED role (promise completes exceptionally).
Threads
Use Task.ContinueWith(Action<Task>) method on the resulting promise to receive notification when the promise becomes done.
Use the following pattern of code to acquire multiple events (either for multiple symbols and/or multiple events) and wait with a single timeout for all of them:
E | The event type. |
symbols | The collection of symbols. |
cancellationToken | The task cancellation token. |
ArgumentException | The one of symbols is not string or CandleSymbol. |
ArgumentNullException | The one of symbols is null . |
Implemented in com.dxfeed.api.DXFeed.
E | : | class | |
E | : | IDxLastingEvent |
Task<List<E> > com.dxfeed.api.IDXFeed.GetTimeSeriesPromise< E > | ( | object | symbol, |
long | fromTime, | ||
long | toTime, | ||
CancellationToken | cancellationToken | ||
) |
Requests time series of events for the specified event type, symbol, and a range of time. This method works only for event types that implement IDxTimeSeriesEvent interface. This method requests the data from the the uplink data provider, creates a list of events of the specified event type E
, and completes the resulting promise with this list. The events are ordered by IDxTimeSeriesEvent.Time in the list.
This method is designed for retrieval of a snapshot only. Use IDxConnection.CreateSnapshotSubscription(EventType, long, IDxSnapshotListener) if you need a list of time-series events that updates in real time.
The range and depth of events that are available with this service is typically constrained by upstream data provider.
The promise is TaskStatus.Canceled when the the underlying DXEndpoint is DXEndpoint.Close(). If the event is not available for any transient reason (no subscription, no connection to uplink, etc), then the resulting promise completes when the issue is resolved, which may involve an arbitrarily long wait. Use CancellationTokenSource class constructors and methods to specify timeout while waiting for promise to complete. If the event is permanently not available (not supported), then the promise completes exceptionally with AggregateException.
Note, that this method does not work when DXEndpoint was created with DXEndpoint.Role::STREAM_FEED role (promise completes exceptionally).
Event flags
This method completes promise only when a consistent snapshot of time series has been received from the data feed. The IDxIndexedEvent.EventFlags property of the events in the resulting list is always zero.
Threads
Use Task.ContinueWith(Action<Task>) method on the resulting promise to receive notification when the promise becomes done.
E | The event type. |
symbol | The symbol. |
fromTime | The time, inclusive, to request events from IDxTimeSeriesEvent.Time. |
toTime | The time, inclusive, to request events to IDxTimeSeriesEvent.Time. Use long.MaxValue to retrieve events without an upper limit on time. |
cancellationToken | The task cancellation token. |
ArgumentException | The symbol symbol is not one of string or CandleSymbol. |
ArgumentNullException | The symbol is null. |
Implemented in com.dxfeed.api.DXFeed.
E | : | IDxTimeSeriesEvent |