dxFeed Graal Native SDK 3.13.0-rc2
Loading...
Searching...
No Matches
dxfg_events.h File Reference

dxFeed Graal Native SDK Events functions and types declarations More...

#include <stdint.h>
#include "dxfg_common.h"
#include "dxfg_javac.h"

Go to the source code of this file.

Data Structures

struct  dxfg_indexed_event_source_t
 The source of indexed events. More...
struct  dxfg_indexed_event_source_list
 A list of event sources. More...
struct  dxfg_symbol_t
 The base structure of every symbol: the first field of all the symbol structures. More...
struct  dxfg_string_symbol_t
 A string symbol (for example, a ticker). More...
struct  dxfg_wildcard_symbol_t
 The wildcard symbol: the subscription to all symbols of an event type. More...
struct  dxfg_candle_symbol_t
 A candle symbol. More...
struct  dxfg_indexed_event_subscription_symbol_t
 The subscription to the indexed events of one source. More...
struct  dxfg_time_series_subscription_symbol_t
 The subscription to the time series of events from a time. More...
struct  dxfg_symbol_list
 A list of symbols. More...
struct  dxfg_event_type_t
 The base structure of every event: the first field of all the event structures. More...
struct  dxfg_market_event_t
 The base structure of the market events: the event symbol and the event time. More...
struct  dxfg_quote_t
 The quote event: a snapshot of the best bid and ask prices and sizes. More...
struct  dxfg_profile_t
 The profile event: a snapshot of the description of a security instrument. More...
struct  dxfg_summary_t
 The summary event: a snapshot of the trading session information (highs, lows and so on). More...
struct  dxfg_greeks_t
 The Greeks event: a snapshot of the option price, the Black-Scholes volatility and the greeks. More...
struct  dxfg_candle_t
 The candle event: OHLC prices and other information for a specific period. More...
struct  dxfg_daily_candle_t
 The daily candle event (deprecated in Java, use dxfg_candle_t): a candle with the same fields. More...
struct  dxfg_underlying_t
 The underlying event: a snapshot of the values computed for an option underlying symbol. More...
struct  dxfg_theo_price_t
 The theo price event: a snapshot of the theoretical option price computation. More...
struct  dxfg_trade_base_t
 The common fields of the trade events: dxfg_trade_t and dxfg_trade_eth_t. More...
struct  dxfg_trade_t
 The trade event: the last trade during the regular trading hours (RTH) and the volume and turnover of the day. More...
struct  dxfg_trade_eth_t
 The TradeETH event: the last trade during the extended trading hours (ETH) and their volume and turnover. More...
struct  dxfg_configuration_t
 The configuration event: an application-specific attachment with a version. More...
struct  dxfg_message_t
 The message event: a notification with an application-specific attachment. More...
struct  dxfg_time_and_sale_t
 The time and sale event: a trade or another market event with a price, in a continuous time slice. More...
struct  dxfg_option_sale_t
 The option sale event: a trade or another market event with a price for an option of an underlying. More...
struct  dxfg_market_maker_t
 The market maker event: a snapshot of the aggregated top quotes of a market participant. More...
struct  dxfg_order_base_t
 The common fields of the order events: dxfg_order_t, dxfg_spread_order_t and the structures built on them. More...
struct  dxfg_order_t
 The order event: a snapshot of the market depth (an order or a price level) of a symbol. More...
struct  dxfg_analytic_order_t
 The analytic order event: an order with the iceberg information. More...
struct  dxfg_otc_markets_order_t
 The OTC Markets order event: an order with the OTC Markets specific quote data. More...
struct  dxfg_spread_order_t
 The spread order event: a snapshot of the market depth of the spreads on an underlying symbol. More...
struct  dxfg_series_t
 The series event: a snapshot of the values computed for an option series of an underlying symbol. More...
struct  dxfg_text_message_t
 The text message event: a notification with a text. More...
struct  dxfg_text_configuration_t
 The text configuration event: a text with a version. More...
struct  dxfg_nuam_order_t
 The Nuam order event: an order with the data of the Nuam Exchange matching engine. More...
struct  dxfg_nuam_time_and_sale_t
 The Nuam time and sale event: a time and sale with the data of the Nuam Exchange. More...
struct  dxfg_nuam_trade_t
 The Nuam trade event: a trade with the trade statistics of the Nuam Exchange. More...
struct  dxfg_order_imbalance_t
 The order imbalance event: the order book statistics during an auction. More...
struct  dxfg_event_type_list
 A list of events. More...
struct  dxfg_event_clazz_list_t
 A list of event classes. More...
struct  dxfg_observable_subscription_change_listener_t
 A handle of a Java ObservableSubscriptionChangeListener object; release it with dxfg_JavaObjectHandler_release(). More...

Typedefs

typedef enum dxfg_indexed_event_source_type_t dxfg_indexed_event_source_type_t
 The kind of an event source, see dxfg_indexed_event_source_t.
typedef struct dxfg_indexed_event_source_t dxfg_indexed_event_source_t
 The source of indexed events.
typedef struct dxfg_indexed_event_source_list dxfg_indexed_event_source_list
 A list of event sources.
typedef enum dxfg_symbol_type_t dxfg_symbol_type_t
 The kind of a symbol, see dxfg_symbol_t.
typedef struct dxfg_symbol_t dxfg_symbol_t
 The base structure of every symbol: the first field of all the symbol structures.
typedef struct dxfg_string_symbol_t dxfg_string_symbol_t
 A string symbol (for example, a ticker).
typedef struct dxfg_wildcard_symbol_t dxfg_wildcard_symbol_t
 The wildcard symbol: the subscription to all symbols of an event type.
typedef struct dxfg_candle_symbol_t dxfg_candle_symbol_t
 A candle symbol.
typedef struct dxfg_indexed_event_subscription_symbol_t dxfg_indexed_event_subscription_symbol_t
 The subscription to the indexed events of one source.
typedef struct dxfg_time_series_subscription_symbol_t dxfg_time_series_subscription_symbol_t
 The subscription to the time series of events from a time.
typedef struct dxfg_symbol_list dxfg_symbol_list
 A list of symbols.
typedef enum dxfg_event_clazz_t dxfg_event_clazz_t
 The class of an event: tells which structure an event (dxfg_event_type_t) is.
typedef struct dxfg_event_type_t dxfg_event_type_t
 The base structure of every event: the first field of all the event structures.
typedef struct dxfg_market_event_t dxfg_market_event_t
 The base structure of the market events: the event symbol and the event time.
typedef struct dxfg_quote_t dxfg_quote_t
 The quote event: a snapshot of the best bid and ask prices and sizes.
typedef struct dxfg_profile_t dxfg_profile_t
 The profile event: a snapshot of the description of a security instrument.
typedef struct dxfg_summary_t dxfg_summary_t
 The summary event: a snapshot of the trading session information (highs, lows and so on).
typedef struct dxfg_greeks_t dxfg_greeks_t
 The Greeks event: a snapshot of the option price, the Black-Scholes volatility and the greeks.
typedef struct dxfg_candle_t dxfg_candle_t
 The candle event: OHLC prices and other information for a specific period.
typedef struct dxfg_daily_candle_t dxfg_daily_candle_t
 The daily candle event (deprecated in Java, use dxfg_candle_t): a candle with the same fields.
typedef struct dxfg_underlying_t dxfg_underlying_t
 The underlying event: a snapshot of the values computed for an option underlying symbol.
typedef struct dxfg_theo_price_t dxfg_theo_price_t
 The theo price event: a snapshot of the theoretical option price computation.
typedef struct dxfg_trade_base_t dxfg_trade_base_t
 The common fields of the trade events: dxfg_trade_t and dxfg_trade_eth_t.
typedef struct dxfg_trade_t dxfg_trade_t
 The trade event: the last trade during the regular trading hours (RTH) and the volume and turnover of the day.
typedef struct dxfg_trade_eth_t dxfg_trade_eth_t
 The TradeETH event: the last trade during the extended trading hours (ETH) and their volume and turnover.
typedef struct dxfg_configuration_t dxfg_configuration_t
 The configuration event: an application-specific attachment with a version.
typedef struct dxfg_message_t dxfg_message_t
 The message event: a notification with an application-specific attachment.
typedef struct dxfg_time_and_sale_t dxfg_time_and_sale_t
 The time and sale event: a trade or another market event with a price, in a continuous time slice.
typedef struct dxfg_option_sale_t dxfg_option_sale_t
 The option sale event: a trade or another market event with a price for an option of an underlying.
typedef struct dxfg_market_maker_t dxfg_market_maker_t
 The market maker event: a snapshot of the aggregated top quotes of a market participant.
typedef struct dxfg_order_base_t dxfg_order_base_t
 The common fields of the order events: dxfg_order_t, dxfg_spread_order_t and the structures built on them.
typedef struct dxfg_order_t dxfg_order_t
 The order event: a snapshot of the market depth (an order or a price level) of a symbol.
typedef struct dxfg_analytic_order_t dxfg_analytic_order_t
 The analytic order event: an order with the iceberg information.
typedef struct dxfg_otc_markets_order_t dxfg_otc_markets_order_t
 The OTC Markets order event: an order with the OTC Markets specific quote data.
typedef struct dxfg_spread_order_t dxfg_spread_order_t
 The spread order event: a snapshot of the market depth of the spreads on an underlying symbol.
typedef struct dxfg_series_t dxfg_series_t
 The series event: a snapshot of the values computed for an option series of an underlying symbol.
typedef struct dxfg_text_message_t dxfg_text_message_t
 The text message event: a notification with a text.
typedef struct dxfg_text_configuration_t dxfg_text_configuration_t
 The text configuration event: a text with a version.
typedef struct dxfg_nuam_order_t dxfg_nuam_order_t
 The Nuam order event: an order with the data of the Nuam Exchange matching engine.
typedef struct dxfg_nuam_time_and_sale_t dxfg_nuam_time_and_sale_t
 The Nuam time and sale event: a time and sale with the data of the Nuam Exchange.
typedef struct dxfg_nuam_trade_t dxfg_nuam_trade_t
 The Nuam trade event: a trade with the trade statistics of the Nuam Exchange.
typedef struct dxfg_order_imbalance_t dxfg_order_imbalance_t
 The order imbalance event: the order book statistics during an auction.
typedef struct dxfg_event_type_list dxfg_event_type_list
 A list of events.
typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t
 A list of event classes.
typedef struct dxfg_observable_subscription_change_listener_t dxfg_observable_subscription_change_listener_t
 A handle of a Java ObservableSubscriptionChangeListener object; release it with dxfg_JavaObjectHandler_release().
typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded(graal_isolatethread_t *thread, dxfg_symbol_list *symbols, void *user_data)
typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_symbolsRemoved(graal_isolatethread_t *thread, dxfg_symbol_list *symbols, void *user_data)
typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_subscriptionClosed(graal_isolatethread_t *thread, void *user_data)

Enumerations

enum  dxfg_indexed_event_source_type_t { INDEXED_EVENT_SOURCE = 0 , ORDER_SOURCE }
 The kind of an event source, see dxfg_indexed_event_source_t. More...
enum  dxfg_symbol_type_t {
  STRING = 0 , CANDLE , WILDCARD , INDEXED_EVENT_SUBSCRIPTION ,
  TIME_SERIES_SUBSCRIPTION
}
 The kind of a symbol, see dxfg_symbol_t. More...
enum  dxfg_event_clazz_t {
  DXFG_EVENT_QUOTE = 0 , DXFG_EVENT_PROFILE , DXFG_EVENT_SUMMARY , DXFG_EVENT_GREEKS ,
  DXFG_EVENT_CANDLE , DXFG_EVENT_DAILY_CANDLE , DXFG_EVENT_UNDERLYING , DXFG_EVENT_THEO_PRICE ,
  DXFG_EVENT_TRADE , DXFG_EVENT_TRADE_ETH , DXFG_EVENT_CONFIGURATION , DXFG_EVENT_MESSAGE ,
  DXFG_EVENT_TIME_AND_SALE , DXFG_EVENT_ORDER_BASE , DXFG_EVENT_ORDER , DXFG_EVENT_ANALYTIC_ORDER ,
  DXFG_EVENT_OTC_MARKETS_ORDER , DXFG_EVENT_SPREAD_ORDER , DXFG_EVENT_SERIES , DXFG_EVENT_OPTION_SALE ,
  DXFG_EVENT_TEXT_MESSAGE , DXFG_EVENT_MARKET_MAKER , DXFG_EVENT_TEXT_CONFIGURATION , DXFG_EVENT_NUAM_ORDER ,
  DXFG_EVENT_NUAM_TIME_AND_SALE , DXFG_EVENT_NUAM_TRADE , DXFG_EVENT_ORDER_IMBALANCE
}
 The class of an event: tells which structure an event (dxfg_event_type_t) is. More...

Functions

dxfg_symbol_t * dxfg_Symbol_new (graal_isolatethread_t *thread, const char *symbol, dxfg_symbol_type_t symbolType)
int32_t dxfg_Symbol_release (graal_isolatethread_t *thread, dxfg_symbol_t *symbol)
dxfg_event_type_t * dxfg_EventType_new (graal_isolatethread_t *thread, const char *symbolName, dxfg_event_clazz_t clazz)
int32_t dxfg_EventType_release (graal_isolatethread_t *thread, dxfg_event_type_t *eventType)
int32_t dxfg_CList_EventType_release (graal_isolatethread_t *thread, dxfg_event_type_list *eventTypes)
int32_t dxfg_CList_EventClazz_release (graal_isolatethread_t *thread, dxfg_event_clazz_list_t *eventClazzes)
int32_t dxfg_CList_symbol_release (graal_isolatethread_t *thread, dxfg_symbol_list *symbols)
dxfg_indexed_event_source_t * dxfg_IndexedEvent_getSource (graal_isolatethread_t *thread, dxfg_event_type_t *eventType)
dxfg_indexed_event_source_t * dxfg_IndexedEventSource_new (graal_isolatethread_t *thread, const char *source)
int32_t dxfg_IndexedEventSource_new2 (graal_isolatethread_t *thread, int32_t sourceId, DXFG_OUT dxfg_indexed_event_source_t **source)
int32_t dxfg_IndexedEventSource_release (graal_isolatethread_t *thread, dxfg_indexed_event_source_t *source)
int32_t dxfg_CList_IndexedEventSource_release (graal_isolatethread_t *thread, dxfg_indexed_event_source_list *list)
dxfg_observable_subscription_change_listener_t * dxfg_ObservableSubscriptionChangeListener_new (graal_isolatethread_t *thread, dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded function_symbolsAdded, dxfg_ObservableSubscriptionChangeListener_function_symbolsRemoved function_symbolsRemoved, dxfg_ObservableSubscriptionChangeListener_function_subscriptionClosed function_subscriptionClosed, void *user_data)

Detailed Description

dxFeed Graal Native SDK Events functions and types declarations

Typedef Documentation

◆ dxfg_analytic_order_t

typedef struct dxfg_analytic_order_t dxfg_analytic_order_t

The analytic order event: an order with the iceberg information.

It is an indexed event, its clazz is DXFG_EVENT_ANALYTIC_ORDER.

Javadoc

◆ dxfg_candle_symbol_t

typedef struct dxfg_candle_symbol_t dxfg_candle_symbol_t

A candle symbol.

Javadoc

◆ dxfg_candle_t

typedef struct dxfg_candle_t dxfg_candle_t

The candle event: OHLC prices and other information for a specific period.

It is a lasting event and a time series event, its clazz is DXFG_EVENT_CANDLE.

Javadoc

◆ dxfg_configuration_t

typedef struct dxfg_configuration_t dxfg_configuration_t

The configuration event: an application-specific attachment with a version.

It is a lasting event, its clazz is DXFG_EVENT_CONFIGURATION.

Javadoc

The attachment is handled as in dxfg_message_t. For a string payload prefer dxfg_text_configuration_t.

◆ dxfg_daily_candle_t

typedef struct dxfg_daily_candle_t dxfg_daily_candle_t

The daily candle event (deprecated in Java, use dxfg_candle_t): a candle with the same fields.

Its clazz is DXFG_EVENT_DAILY_CANDLE.

Javadoc

◆ dxfg_event_clazz_list_t

typedef struct dxfg_event_clazz_list_t dxfg_event_clazz_list_t

A list of event classes.

The list returned by the SDK is released with dxfg_CList_EventClazz_release().

◆ dxfg_event_clazz_t

The class of an event: tells which structure an event (dxfg_event_type_t) is.

In the Java implementation, all events are lined up in a hierarchy from the underlying EventType interface. In the C implementation, we specify the type in the event in a separate field because we cannot get it from the class name.

The comment of every value names the Java event class and its kind: a lasting event (LastingEvent: only the latest event of a symbol is kept), an indexed event (IndexedEvent: events of a symbol are told apart by an index and a source) or a time series event (TimeSeriesEvent: an indexed event with a time). The kind of the base class is inherited by its subclasses. The structure of a value is named by the value (DXFG_EVENT_QUOTE: dxfg_quote_t).

◆ dxfg_event_type_list

typedef struct dxfg_event_type_list dxfg_event_type_list

A list of events.

The list returned by the SDK (or passed by the SDK to a listener) is released with dxfg_CList_EventType_release().

◆ dxfg_event_type_t

typedef struct dxfg_event_type_t dxfg_event_type_t

The base structure of every event: the first field of all the event structures.

clazz tells which event structure the pointer really points to (for example, DXFG_EVENT_QUOTE: dxfg_quote_t); cast the pointer to that structure to read the other fields.

Who creates and releases an event:

  • dxfg_EventType_new() creates an event that the caller owns; all its fields besides clazz and the symbol are zero (not NaN).
  • The SDK creates the events that it passes to a listener or returns as a result. An event passed to a listener belongs to the SDK: it is freed after the listener returns, copy what you need to keep. The events returned as a result belong to the caller.
  • An event of either origin, and a list of events, is released with dxfg_EventType_release() and dxfg_CList_EventType_release(): that frees the structure together with all its strings (the const char * fields, such as the event symbol).

Javadoc

◆ dxfg_greeks_t

typedef struct dxfg_greeks_t dxfg_greeks_t

The Greeks event: a snapshot of the option price, the Black-Scholes volatility and the greeks.

It is a lasting event and a time series event, its clazz is DXFG_EVENT_GREEKS.

Javadoc

◆ dxfg_indexed_event_source_list

typedef struct dxfg_indexed_event_source_list dxfg_indexed_event_source_list

A list of event sources.

The list returned by the SDK is released with dxfg_CList_IndexedEventSource_release().

◆ dxfg_indexed_event_source_t

typedef struct dxfg_indexed_event_source_t dxfg_indexed_event_source_t

The source of indexed events.

Create it with dxfg_IndexedEventSource_new() or dxfg_IndexedEventSource_new2(), release it with dxfg_IndexedEventSource_release(). The sources that the SDK returns (for example, by dxfg_IndexedEvent_getSource()) are released the same way.

Javadoc

◆ dxfg_indexed_event_source_type_t

◆ dxfg_indexed_event_subscription_symbol_t

typedef struct dxfg_indexed_event_subscription_symbol_t dxfg_indexed_event_subscription_symbol_t

The subscription to the indexed events of one source.

Javadoc

◆ dxfg_market_event_t

typedef struct dxfg_market_event_t dxfg_market_event_t

The base structure of the market events: the event symbol and the event time.

Javadoc

◆ dxfg_market_maker_t

typedef struct dxfg_market_maker_t dxfg_market_maker_t

The market maker event: a snapshot of the aggregated top quotes of a market participant.

It is an indexed event, its clazz is DXFG_EVENT_MARKET_MAKER.

Javadoc

◆ dxfg_message_t

typedef struct dxfg_message_t dxfg_message_t

The message event: a notification with an application-specific attachment.

It is neither a lasting nor an indexed event: messages are never conflated, its clazz is DXFG_EVENT_MESSAGE.

Javadoc

The attachment (the same for dxfg_configuration_t) is a UTF-8 null-terminated string (const char *, declared as void *) or NULL when there is no attachment:

  • Java -> C: a String attachment is passed as is, the other objects are passed as their string representation (toString()), no attachment is NULL. An attachment that Java cannot deserialize (e.g. its class is not registered for the native image) is NULL too, the SDK logs a warning then.
  • C -> Java: the attachment becomes a String, NULL is no attachment.

So a non-string attachment loses its type when it passes through C: if the event is published back (or forwarded to another endpoint), the Java receivers get the string instead of the original object.

The C API does not support arbitrary Java attachments: C can neither create nor read them. For a string payload prefer dxfg_text_message_t and dxfg_text_configuration_t (TextMessage, TextConfiguration): their text is a plain string that passes both ways without loss.

Memory:

  • The events that the SDK gives to the caller (to a listener, from dxfg_DXFeed_getLastEvent(), a promise, etc.) own their strings: the SDK frees them with the event (after the listener returns, or with dxfg_EventType_release() and dxfg_CList_EventType_release()). Copy the attachment to keep it longer.
  • The events that the caller allocates itself and passes to the SDK (dxfg_DXPublisher_publishEvents(), etc.) are only read: the SDK copies the attachment during the call, the caller allocates and frees it.
  • dxfg_EventType_release() of an event created by dxfg_EventType_new() frees its strings with the SDK's allocator. If the caller sets the attachment of such an event to its own string, it resets the attachment to NULL before the release and frees the string itself (the allocators of the caller and of the SDK may differ, e.g. on Windows).

◆ dxfg_nuam_order_t

typedef struct dxfg_nuam_order_t dxfg_nuam_order_t

The Nuam order event: an order with the data of the Nuam Exchange matching engine.

It is an indexed event, its clazz is DXFG_EVENT_NUAM_ORDER.

https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/custom/NuamOrder.html

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_nuam_time_and_sale_t

typedef struct dxfg_nuam_time_and_sale_t dxfg_nuam_time_and_sale_t

The Nuam time and sale event: a time and sale with the data of the Nuam Exchange.

It is a time series event, its clazz is DXFG_EVENT_NUAM_TIME_AND_SALE.

https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/custom/NuamTimeAndSale.html

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_nuam_trade_t

typedef struct dxfg_nuam_trade_t dxfg_nuam_trade_t

The Nuam trade event: a trade with the trade statistics of the Nuam Exchange.

It is a lasting event, its clazz is DXFG_EVENT_NUAM_TRADE.

https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/custom/NuamTrade.html

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_observable_subscription_change_listener_t

typedef struct dxfg_observable_subscription_change_listener_t dxfg_observable_subscription_change_listener_t

A handle of a Java ObservableSubscriptionChangeListener object; release it with dxfg_JavaObjectHandler_release().

Javadoc

◆ dxfg_ObservableSubscriptionChangeListener_function_subscriptionClosed

typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_subscriptionClosed(graal_isolatethread_t *thread, void *user_data)

The callback of a subscription change listener: the subscription was closed, or the listener was removed from it.

It is called in the same way as dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]user_dataThe user data passed to dxfg_ObservableSubscriptionChangeListener_new().

◆ dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded

typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded(graal_isolatethread_t *thread, dxfg_symbol_list *symbols, void *user_data)

The callback of a subscription change listener: symbols were added to the subscription.

It is called by the SDK after the symbols are added to the subscription of the Java side, on a Java thread (not necessarily the thread that registered the listener), while the SDK holds the lock of the subscription: the notifications of one subscription do not run at the same time. The symbols are decorated depending on the subscription: for a time series subscription they are dxfg_time_series_subscription_symbol_t.

The list belongs to the SDK and is freed after the function returns: do not release it, copy the symbols that you need to keep.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolsThe added symbols.
[in]user_dataThe user data passed to dxfg_ObservableSubscriptionChangeListener_new().

◆ dxfg_ObservableSubscriptionChangeListener_function_symbolsRemoved

typedef void(*) dxfg_ObservableSubscriptionChangeListener_function_symbolsRemoved(graal_isolatethread_t *thread, dxfg_symbol_list *symbols, void *user_data)

The callback of a subscription change listener: symbols were removed from the subscription.

It is called in the same way as dxfg_ObservableSubscriptionChangeListener_function_symbolsAdded, after the symbols are removed from the subscription.

The list belongs to the SDK and is freed after the function returns: do not release it, copy the symbols that you need to keep.

Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolsThe removed symbols.
[in]user_dataThe user data passed to dxfg_ObservableSubscriptionChangeListener_new().

◆ dxfg_option_sale_t

typedef struct dxfg_option_sale_t dxfg_option_sale_t

The option sale event: a trade or another market event with a price for an option of an underlying.

It is an indexed event with the default source, its clazz is DXFG_EVENT_OPTION_SALE.

Javadoc

◆ dxfg_order_base_t

typedef struct dxfg_order_base_t dxfg_order_base_t

The common fields of the order events: dxfg_order_t, dxfg_spread_order_t and the structures built on them.

It is an indexed event: a snapshot of the market depth of a symbol. Its clazz is DXFG_EVENT_ORDER_BASE.

Javadoc

◆ dxfg_order_imbalance_t

typedef struct dxfg_order_imbalance_t dxfg_order_imbalance_t

The order imbalance event: the order book statistics during an auction.

It is a market event (neither lasting nor indexed), its clazz is DXFG_EVENT_ORDER_IMBALANCE.

https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/market/OrderImbalance.html

Experimental
It may change or be removed in a minor release, see The v4 functions.

◆ dxfg_order_t

typedef struct dxfg_order_t dxfg_order_t

The order event: a snapshot of the market depth (an order or a price level) of a symbol.

It is an indexed event, its clazz is DXFG_EVENT_ORDER.

Javadoc

◆ dxfg_otc_markets_order_t

typedef struct dxfg_otc_markets_order_t dxfg_otc_markets_order_t

The OTC Markets order event: an order with the OTC Markets specific quote data.

It is an indexed event, its clazz is DXFG_EVENT_OTC_MARKETS_ORDER. The original OTC quote is presented as two events: the bid and the ask side.

Javadoc

◆ dxfg_profile_t

typedef struct dxfg_profile_t dxfg_profile_t

The profile event: a snapshot of the description of a security instrument.

It is a lasting event, its clazz is DXFG_EVENT_PROFILE.

Javadoc

◆ dxfg_quote_t

typedef struct dxfg_quote_t dxfg_quote_t

The quote event: a snapshot of the best bid and ask prices and sizes.

 <a href="https://docs.dxfeed.com/dxfeed/api/com/dxfeed/event/LastingEvent.html">Javadoc</a>
&zwj;/

typedef struct dxfg_lasting_event_t { } dxfg_lasting_event_t;

/** Javadoc ‍/ typedef struct dxfg_indexed_event_t { // dxfg_indexed_event_source_t source; // int32_t event_flags; // int64_t index; } dxfg_indexed_event_t;

/** Javadoc ‍/ typedef struct dxfg_time_series_event_t { dxfg_indexed_event_t indexed_event; // int64_t time; } dxfg_time_series_event_t;

/**

It is a lasting event, its clazz is DXFG_EVENT_QUOTE.

Javadoc

◆ dxfg_series_t

typedef struct dxfg_series_t dxfg_series_t

The series event: a snapshot of the values computed for an option series of an underlying symbol.

It is an indexed event, its clazz is DXFG_EVENT_SERIES.

Javadoc

◆ dxfg_spread_order_t

typedef struct dxfg_spread_order_t dxfg_spread_order_t

The spread order event: a snapshot of the market depth of the spreads on an underlying symbol.

It is an indexed event, its clazz is DXFG_EVENT_SPREAD_ORDER.

Javadoc

◆ dxfg_string_symbol_t

typedef struct dxfg_string_symbol_t dxfg_string_symbol_t

A string symbol (for example, a ticker).

◆ dxfg_summary_t

typedef struct dxfg_summary_t dxfg_summary_t

The summary event: a snapshot of the trading session information (highs, lows and so on).

It is a lasting event, its clazz is DXFG_EVENT_SUMMARY.

Javadoc

◆ dxfg_symbol_list

typedef struct dxfg_symbol_list dxfg_symbol_list

A list of symbols.

The list returned by the SDK (or passed by the SDK to a listener) is released with dxfg_CList_symbol_release().

◆ dxfg_symbol_t

typedef struct dxfg_symbol_t dxfg_symbol_t

The base structure of every symbol: the first field of all the symbol structures.

type tells which of the structures dxfg_string_symbol_t, dxfg_candle_symbol_t, dxfg_wildcard_symbol_t, dxfg_indexed_event_subscription_symbol_t and dxfg_time_series_subscription_symbol_t the pointer really points to; cast the pointer to it to read the other fields.

A symbol created by dxfg_Symbol_new() or returned by the SDK is released with dxfg_Symbol_release() (a list of symbols with dxfg_CList_symbol_release()): that frees the structure, its strings and the nested symbols and sources.

◆ dxfg_symbol_type_t

The kind of a symbol, see dxfg_symbol_t.

◆ dxfg_text_configuration_t

typedef struct dxfg_text_configuration_t dxfg_text_configuration_t

The text configuration event: a text with a version.

It is a lasting event, its clazz is DXFG_EVENT_TEXT_CONFIGURATION.

Javadoc

◆ dxfg_text_message_t

typedef struct dxfg_text_message_t dxfg_text_message_t

The text message event: a notification with a text.

It is neither a lasting nor an indexed event: messages are never conflated, its clazz is DXFG_EVENT_TEXT_MESSAGE.

Javadoc

◆ dxfg_theo_price_t

typedef struct dxfg_theo_price_t dxfg_theo_price_t

The theo price event: a snapshot of the theoretical option price computation.

It is a lasting event and a time series event, its clazz is DXFG_EVENT_THEO_PRICE.

Javadoc

◆ dxfg_time_and_sale_t

typedef struct dxfg_time_and_sale_t dxfg_time_and_sale_t

The time and sale event: a trade or another market event with a price, in a continuous time slice.

It is a time series event, its clazz is DXFG_EVENT_TIME_AND_SALE. Its time is the one in index, there is no separate time field.

Javadoc

◆ dxfg_time_series_subscription_symbol_t

typedef struct dxfg_time_series_subscription_symbol_t dxfg_time_series_subscription_symbol_t

The subscription to the time series of events from a time.

The source of such a subscription is always the default one.

Javadoc

◆ dxfg_trade_base_t

typedef struct dxfg_trade_base_t dxfg_trade_base_t

The common fields of the trade events: dxfg_trade_t and dxfg_trade_eth_t.

It is a lasting event, the information about the last trade. There is no event class of its own in the C API.

Javadoc

◆ dxfg_trade_eth_t

typedef struct dxfg_trade_eth_t dxfg_trade_eth_t

The TradeETH event: the last trade during the extended trading hours (ETH) and their volume and turnover.

It is a lasting event, its clazz is DXFG_EVENT_TRADE_ETH.

Javadoc

◆ dxfg_trade_t

typedef struct dxfg_trade_t dxfg_trade_t

The trade event: the last trade during the regular trading hours (RTH) and the volume and turnover of the day.

It is a lasting event, its clazz is DXFG_EVENT_TRADE.

Javadoc

◆ dxfg_underlying_t

typedef struct dxfg_underlying_t dxfg_underlying_t

The underlying event: a snapshot of the values computed for an option underlying symbol.

It is a lasting event and a time series event, its clazz is DXFG_EVENT_UNDERLYING.

Javadoc

◆ dxfg_wildcard_symbol_t

typedef struct dxfg_wildcard_symbol_t dxfg_wildcard_symbol_t

The wildcard symbol: the subscription to all symbols of an event type.

It has no fields besides the base structure.

Javadoc

Enumeration Type Documentation

◆ dxfg_event_clazz_t

The class of an event: tells which structure an event (dxfg_event_type_t) is.

In the Java implementation, all events are lined up in a hierarchy from the underlying EventType interface. In the C implementation, we specify the type in the event in a separate field because we cannot get it from the class name.

The comment of every value names the Java event class and its kind: a lasting event (LastingEvent: only the latest event of a symbol is kept), an indexed event (IndexedEvent: events of a symbol are told apart by an index and a source) or a time series event (TimeSeriesEvent: an indexed event with a time). The kind of the base class is inherited by its subclasses. The structure of a value is named by the value (DXFG_EVENT_QUOTE: dxfg_quote_t).

Enumerator
DXFG_EVENT_QUOTE 

Quote, a lasting event: the best bid and ask.

DXFG_EVENT_PROFILE 

Profile, a lasting event: the description of an instrument.

DXFG_EVENT_SUMMARY 

Summary, a lasting event: the trading session information.

DXFG_EVENT_GREEKS 

Greeks, a lasting event and a time series event: the option price and greeks.

DXFG_EVENT_CANDLE 

Candle, a lasting event and a time series event: OHLC and other values of a period.

DXFG_EVENT_DAILY_CANDLE 

DailyCandle (deprecated in Java, use Candle): a Candle with the same fields.

DXFG_EVENT_UNDERLYING 

Underlying, a lasting event and a time series event: the values of an underlying.

DXFG_EVENT_THEO_PRICE 

TheoPrice, a lasting event and a time series event: the theoretical option price.

DXFG_EVENT_TRADE 

Trade (extends TradeBase), a lasting event: the last trade in RTH.

DXFG_EVENT_TRADE_ETH 

TradeETH (extends TradeBase), a lasting event: the last trade in ETH.

DXFG_EVENT_CONFIGURATION 

Configuration, a lasting event: an attachment with a version.

DXFG_EVENT_MESSAGE 

Message: a notification with an attachment (neither lasting nor indexed).

DXFG_EVENT_TIME_AND_SALE 

TimeAndSale, a time series event: a trade or another market event.

DXFG_EVENT_ORDER_BASE 

OrderBase, an indexed event: the common fields of the order events.

DXFG_EVENT_ORDER 

Order (extends OrderBase), an indexed event: an order or a price level.

DXFG_EVENT_ANALYTIC_ORDER 

AnalyticOrder (extends Order), an indexed event: an Order with iceberg data.

DXFG_EVENT_OTC_MARKETS_ORDER 

OtcMarketsOrder (extends Order), an indexed event: an OTC Markets quote.

DXFG_EVENT_SPREAD_ORDER 

SpreadOrder (extends OrderBase), an indexed event: a spread order.

DXFG_EVENT_SERIES 

Series, an indexed event: the values of an option series.

DXFG_EVENT_OPTION_SALE 

OptionSale, an indexed event: a trade of an option.

DXFG_EVENT_TEXT_MESSAGE 

TextMessage: a notification with a text (neither lasting nor indexed).

DXFG_EVENT_MARKET_MAKER 

MarketMaker, an indexed event: the top quotes of a market participant.

DXFG_EVENT_TEXT_CONFIGURATION 

TextConfiguration, a lasting event: a text with a version.

DXFG_EVENT_NUAM_ORDER 

NuamOrder (extends Order), an indexed event: an order of the Nuam Exchange.

DXFG_EVENT_NUAM_TIME_AND_SALE 

NuamTimeAndSale (extends TimeAndSale), a time series event (Nuam Exchange).

DXFG_EVENT_NUAM_TRADE 

NuamTrade (extends Trade), a lasting event: Nuam Exchange trade statistics.

DXFG_EVENT_ORDER_IMBALANCE 

OrderImbalance, a market event (neither lasting nor indexed): auction imbalance.

◆ dxfg_indexed_event_source_type_t

The kind of an event source, see dxfg_indexed_event_source_t.

Enumerator
INDEXED_EVENT_SOURCE 

A plain IndexedEventSource (for example, the default source with the identifier 0).

ORDER_SOURCE 

An OrderSource: the source of order events.

◆ dxfg_symbol_type_t

The kind of a symbol, see dxfg_symbol_t.

Enumerator
STRING 

A string symbol, the structure is dxfg_string_symbol_t.

CANDLE 

A candle symbol, the structure is dxfg_candle_symbol_t.

WILDCARD 

The wildcard symbol (the subscription to all symbols), the structure is dxfg_wildcard_symbol_t.

INDEXED_EVENT_SUBSCRIPTION 

The subscription to the events of one source, the structure is dxfg_indexed_event_subscription_symbol_t.

TIME_SERIES_SUBSCRIPTION 

The subscription to the time series from a time, the structure is dxfg_time_series_subscription_symbol_t.

Function Documentation

◆ dxfg_CList_EventClazz_release()

int32_t dxfg_CList_EventClazz_release ( graal_isolatethread_t * thread,
dxfg_event_clazz_list_t * eventClazzes )

Releases a list of event classes: frees the list, its array and every element. Passing NULL does nothing.

Deprecated
Use dxfg_v4_event_clazz_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventClazzesThe list of event classes returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_CList_EventType_release()

int32_t dxfg_CList_EventType_release ( graal_isolatethread_t * thread,
dxfg_event_type_list * eventTypes )

Releases a list of events: frees the list, its array and every event of the list together with its strings. Passing NULL does nothing.

Deprecated
Use dxfg_v4_event_type_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventTypesThe list of events returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_CList_IndexedEventSource_release()

int32_t dxfg_CList_IndexedEventSource_release ( graal_isolatethread_t * thread,
dxfg_indexed_event_source_list * list )

Releases a list of event sources: frees the list, its array and every source of the list with its name. Passing NULL does nothing.

Deprecated
Use dxfg_v4_indexed_event_source_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]listThe list of sources returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_CList_symbol_release()

int32_t dxfg_CList_symbol_release ( graal_isolatethread_t * thread,
dxfg_symbol_list * symbols )

Releases a list of symbols: frees the list, its array and every symbol of the list with its strings and the nested symbols and sources.

Deprecated
Use dxfg_v4_symbol_list_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolsThe list of symbols returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_EventType_new()

dxfg_event_type_t * dxfg_EventType_new ( graal_isolatethread_t * thread,
const char * symbolName,
dxfg_event_clazz_t clazz )

Creates an event of the given class for the given symbol.

The event has the given clazz and event symbol (a copy of the string), all the other fields are zero (not NaN and not the defaults of the Java event). Fill the fields, then pass the event to a function that needs it.

Deprecated
Use dxfg_v4_EventType_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolNameThe event symbol: a UTF-8 null-terminated string. For DXFG_EVENT_CANDLE and DXFG_EVENT_DAILY_CANDLE it is the string form of a candle symbol.
[in]clazzThe class of the event to create.
Returns
The event (release it with dxfg_EventType_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

◆ dxfg_EventType_release()

int32_t dxfg_EventType_release ( graal_isolatethread_t * thread,
dxfg_event_type_t * eventType )

Releases an event: frees the structure together with all its strings. Passing NULL does nothing.

Use it for the events created by dxfg_EventType_new() and for the events that the SDK returns to the caller as a result. Do not release an event that the SDK passed to a listener: the SDK frees it after the listener returns.

Deprecated
Use dxfg_v4_EventType_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventTypeThe event to release.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_IndexedEvent_getSource()

dxfg_indexed_event_source_t * dxfg_IndexedEvent_getSource ( graal_isolatethread_t * thread,
dxfg_event_type_t * eventType )

Returns the source of an indexed event.

It works for the events of DXFG_EVENT_GREEKS, DXFG_EVENT_CANDLE, DXFG_EVENT_DAILY_CANDLE, DXFG_EVENT_TIME_AND_SALE, DXFG_EVENT_UNDERLYING, DXFG_EVENT_THEO_PRICE and DXFG_EVENT_SERIES (the default source) and of DXFG_EVENT_ORDER_BASE, DXFG_EVENT_ORDER, DXFG_EVENT_ANALYTIC_ORDER and DXFG_EVENT_SPREAD_ORDER (the source stored in the index of the order). For the events of any other class the function fails.

Deprecated
Use dxfg_v4_IndexedEvent_getSource().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]eventTypeThe event.
Returns
The source (release it with dxfg_IndexedEventSource_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: IndexedEvent.getSource().

◆ dxfg_IndexedEventSource_new()

dxfg_indexed_event_source_t * dxfg_IndexedEventSource_new ( graal_isolatethread_t * thread,
const char * source )

Creates an event source by its name.

Deprecated
Use dxfg_v4_IndexedEventSource_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]sourceThe name of the order source: a UTF-8 null-terminated string, either predefined or at most four alphanumeric characters. If it is NULL, the default source (the identifier 0) is returned instead.
Returns
The source (release it with dxfg_IndexedEventSource_release()), or NULL on error (for example, for an invalid name). Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: OrderSource.valueOf(String).

◆ dxfg_IndexedEventSource_new2()

int32_t dxfg_IndexedEventSource_new2 ( graal_isolatethread_t * thread,
int32_t sourceId,
DXFG_OUT dxfg_indexed_event_source_t ** source )

Creates an event source by its identifier.

Deprecated
Use dxfg_v4_IndexedEventSource_newWithId().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]sourceIdThe identifier of the source. If it is 0, the default source is returned, otherwise it is the identifier of an order source (a negative identifier is an error).
[out]sourceThe pointer to the source (release it with dxfg_IndexedEventSource_release()). It is not written on error.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

Java: OrderSource.valueOf(int).

◆ dxfg_IndexedEventSource_release()

int32_t dxfg_IndexedEventSource_release ( graal_isolatethread_t * thread,
dxfg_indexed_event_source_t * source )

Releases an event source: frees the structure and its name. Passing NULL does nothing.

Deprecated
Use dxfg_v4_IndexedEventSource_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]sourceThe source created by dxfg_IndexedEventSource_new(), dxfg_IndexedEventSource_new2() or returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.

◆ dxfg_ObservableSubscriptionChangeListener_new()

Creates a listener of the changes of a subscription.

Add the listener to a subscription (for example, with dxfg_DXFeedSubscription_addChangeListener()). The SDK calls the functions without a check for NULL, so pass all three. Releasing the last handle of the listener with dxfg_JavaObjectHandler_release() (or dxfg_NativeListener_deactivate()) stops the calls: after that none of the functions is called or running, and the user data can be freed.

Deprecated
Use dxfg_v4_ObservableSubscriptionChangeListener_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]function_symbolsAddedThe function called when symbols are added to the subscription.
[in]function_symbolsRemovedThe function called when symbols are removed from the subscription.
[in]function_subscriptionClosedThe function called when the subscription is closed or the listener is removed.
[in]user_dataThe user data passed to every function; the SDK does not use or free it.
Returns
The listener handle (release it with dxfg_JavaObjectHandler_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: ObservableSubscriptionChangeListener (symbolsAdded(Set), symbolsRemoved(Set), subscriptionClosed()).

◆ dxfg_Symbol_new()

dxfg_symbol_t * dxfg_Symbol_new ( graal_isolatethread_t * thread,
const char * symbol,
dxfg_symbol_type_t symbolType )

Creates a symbol of the given type.

Only STRING, CANDLE and WILDCARD can be created here: for any other type the function fails. For CANDLE the string is parsed as a candle symbol (an invalid string is an error) and the symbol of the created structure is its normalized string form. For WILDCARD the string is ignored.

Deprecated
Use dxfg_v4_Symbol_new().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolThe symbol: a UTF-8 null-terminated string.
[in]symbolTypeThe type of the symbol to create.
Returns
The symbol (release it with dxfg_Symbol_release()), or NULL on error. Use dxfg_get_and_clear_thread_exception_t() to get the exception.

Java: CandleSymbol.valueOf(String) for CANDLE, WildcardSymbol.ALL for WILDCARD.

◆ dxfg_Symbol_release()

int32_t dxfg_Symbol_release ( graal_isolatethread_t * thread,
dxfg_symbol_t * symbol )

Releases a symbol: frees the structure, its strings and the nested symbols and sources. Passing NULL does nothing.

Deprecated
Use dxfg_v4_Symbol_release().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]symbolThe symbol created by dxfg_Symbol_new() or returned by the SDK.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.