dxFeed C API  6.0.1
dxFeed C API library intended to provide market data access for DX clients
Data Structures | Macros | Typedefs | Enumerations | Functions
EventData.h File Reference

dxFeed C API event data structures declarations More...

#include "RecordData.h"
#include "DXTypes.h"
#include <limits.h>
#include <math.h>
Include dependency graph for EventData.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dx_suffix_t
 Suffix. More...
 
struct  dx_order_source_array_t
 Order source. More...
 
struct  dxf_trade_t
 Trade. More...
 
struct  dxf_quote_t
 Quote. More...
 
struct  dxf_summary_t
 Summary. More...
 
struct  dxf_profile_t
 Profile. More...
 
struct  dxf_order_t
 Order. More...
 
struct  dxf_time_and_sale_t
 Time & sale. More...
 
struct  dxf_candle_t
 Candle. More...
 
struct  dxf_greeks_t
 Greeks. More...
 
struct  dxf_series_t
 Series. More...
 
struct  dxf_configuration_t
 Configuration. More...
 
struct  dxf_event_params_t
 Event params. More...
 
struct  dx_event_subscription_param_t
 Event subscription param. More...
 
struct  dx_event_subscription_param_list_t
 Event subscription param list. More...
 
struct  dxf_snapshot_data_t
 Snapshot. More...
 
struct  dxf_price_level_element_t
 Price level element. More...
 
struct  dxf_price_level_book_data_t
 Price level book data. More...
 

Macros

#define OUT
 
#define DXF_ET_TRADE   (1u << (unsigned)dx_eid_trade)
 Trade event.
 
#define DXF_ET_QUOTE   (1u << (unsigned)dx_eid_quote)
 Quote event.
 
#define DXF_ET_SUMMARY   (1u << (unsigned)dx_eid_summary)
 Summary event.
 
#define DXF_ET_PROFILE   (1u << (unsigned)dx_eid_profile)
 Profile event.
 
#define DXF_ET_ORDER   (1u << (unsigned)dx_eid_order)
 Order event.
 
#define DXF_ET_TIME_AND_SALE   (1u << (unsigned)dx_eid_time_and_sale)
 Time & sale event.
 
#define DXF_ET_CANDLE   (1u << (unsigned)dx_eid_candle)
 Candle event.
 
#define DXF_ET_TRADE_ETH   (1u << (unsigned)dx_eid_trade_eth)
 Trade eth event.
 
#define DXF_ET_SPREAD_ORDER   (1u << (unsigned)dx_eid_spread_order)
 Spread order event.
 
#define DXF_ET_GREEKS   (1u << (unsigned)dx_eid_greeks)
 Greeks event.
 
#define DXF_ET_THEO_PRICE   (1u << (unsigned)dx_eid_theo_price)
 Theo price event.
 
#define DXF_ET_UNDERLYING   (1u << (unsigned)dx_eid_underlying)
 Underlying event.
 
#define DXF_ET_SERIES   (1u << (unsigned)dx_eid_series)
 Series event.
 
#define DXF_ET_CONFIGURATION   (1u << (unsigned)dx_eid_configuration)
 Configuration event.
 
#define DXF_ET_UNUSED   (~((1u << (unsigned)dx_eid_count) - 1u))
 
#define DX_EVENT_BIT_MASK(event_id)   (1u << (unsigned)event_id)
 Event bit-mask.
 
#define DXF_RECORD_SUFFIX_SIZE   5
 
#define DXF_CANDLE_EXCHANGE_CODE_COMPOSITE_ATTRIBUTE   L'\0'
 
#define DXF_CANDLE_EXCHANGE_CODE_ATTRIBUTE_DEFAULT   DXF_CANDLE_EXCHANGE_CODE_COMPOSITE_ATTRIBUTE
 
#define DXF_CANDLE_PERIOD_VALUE_ATTRIBUTE_DEFAULT   1.0
 
#define DXF_CANDLE_PRICE_LEVEL_ATTRIBUTE_DEFAULT   (NAN)
 
#define DXF_IS_CANDLE_REMOVAL(c)   (((c)->event_flags & dxf_ef_remove_event) != 0)
 
#define DXF_IS_ORDER_REMOVAL(o)   ((((o)->event_flags & dxf_ef_remove_event) != 0) || ((o)->size == 0))
 
#define DXF_IS_SPREAD_ORDER_REMOVAL(o)   ((((o)->event_flags & dxf_ef_remove_event) != 0) || ((o)->size == 0))
 
#define DXF_IS_TIME_AND_SALE_REMOVAL(t)   (((t)->event_flags & dxf_ef_remove_event) != 0)
 
#define DXF_IS_GREEKS_REMOVAL(g)   (((g)->event_flags & dxf_ef_remove_event) != 0)
 
#define DXF_IS_SERIES_REMOVAL(s)   (((s)->event_flags & dxf_ef_remove_event) != 0)
 

Typedefs

typedef dx_order_source_array_tdx_order_source_array_ptr_t
 Order source array.
 
typedef void * dxf_event_data_t
 Event data.
 
typedef const void * dxf_const_event_data_t
 
typedef dx_theo_price_t dxf_theo_price_t
 Theo price.
 
typedef dx_underlying_t dxf_underlying_t
 Underlying.
 
typedef dxf_ulong_t dxf_time_int_field_t
 
typedef void(* dxf_event_listener_t) (int event_type, dxf_const_string_t symbol_name, const dxf_event_data_t *data, int data_count, void *user_data)
 Event listener prototype.
 
typedef void(* dxf_event_listener_v2_t) (int event_type, dxf_const_string_t symbol_name, const dxf_event_data_t *data, int data_count, const dxf_event_params_t *event_params, void *user_data)
 Event listener prototype v2.
 
typedef struct dxf_snapshot_data_tdxf_snapshot_data_ptr_t
 
typedef void(* dxf_snapshot_listener_t) (const dxf_snapshot_data_ptr_t snapshot_data, void *user_data)
 Snapshot listener prototype. More...
 
typedef void(* dxf_snapshot_inc_listener_t) (const dxf_snapshot_data_ptr_t snapshot_data, int new_snapshot, void *user_data)
 Incremental Snapshot listener prototype. More...
 
typedef struct dxf_price_level_book_data_tdxf_price_level_book_data_ptr_t
 
typedef void(* dxf_price_level_book_listener_t) (const dxf_price_level_book_data_ptr_t book, void *user_data)
 Price Level listener prototype. More...
 
typedef void(* dxf_regional_quote_listener_t) (dxf_const_string_t symbol, const dxf_quote_t *quotes, int count, void *user_data)
 Regional quote listener prototype. More...
 

Enumerations

enum  dx_event_id_t {
  dx_eid_begin = 0u, dx_eid_trade = dx_eid_begin, dx_eid_quote, dx_eid_summary,
  dx_eid_profile, dx_eid_order, dx_eid_time_and_sale, dx_eid_candle,
  dx_eid_trade_eth, dx_eid_spread_order, dx_eid_greeks, dx_eid_theo_price,
  dx_eid_underlying, dx_eid_series, dx_eid_configuration, dx_eid_count,
  dx_eid_invalid
}
 Event ID.
 
enum  dx_event_subscr_flag {
  dx_esf_default = 0x0u, dx_esf_single_record = 0x1u, dx_esf_sr_market_maker_order = 0x2u, dx_esf_time_series = 0x4u,
  dx_esf_quotes_regional = 0x8u, dx_esf_wildcard = 0x10u, dx_esf_force_ticker = 0x20u, dx_esf_force_stream = 0x40u,
  dx_esf_force_history = 0x80u, dx_esf_force_enum_unsigned = UINT_MAX
}
 
enum  dxf_order_scope_t { dxf_osc_composite = 0, dxf_osc_regional = 1, dxf_osc_aggregate = 2, dxf_osc_order = 3 }
 Order scope.
 
enum  dxf_direction_t {
  dxf_dir_undefined = 0, dxf_dir_down = 1, dxf_dir_zero_down = 2, dxf_dir_zero = 3,
  dxf_dir_zero_up = 4, dxf_dir_up = 5
}
 Direction.
 
enum  dxf_price_type_t { dxf_pt_regular = 0, dxf_pt_indicative = 1, dxf_pt_preliminary = 2, dxf_pt_final = 3 }
 Price type.
 
enum  dxf_trading_status_t { dxf_ts_undefined = 0, dxf_ts_halted = 1, dxf_ts_active = 2 }
 Trading status.
 
enum  dxf_short_sale_restriction_t { dxf_ssr_undefined = 0, dxf_ssr_active = 1, dxf_ssr_inactive = 2 }
 Short sale restriction.
 
enum  dxf_order_side_t { dxf_osd_undefined = 0, dxf_osd_buy = 1, dxf_osd_sell = 2 }
 Order side.
 
enum  dxf_tns_type_t { dxf_tnst_new = 0, dxf_tnst_correction = 1, dxf_tnst_cancel = 2 }
 Time & sale type.
 
enum  dxf_candle_price_attribute_t {
  dxf_cpa_last, dxf_cpa_bid, dxf_cpa_ask, dxf_cpa_mark,
  dxf_cpa_settlement, dxf_cpa_count, dxf_cpa_default = dxf_cpa_last
}
 Candle price attribute.
 
enum  dxf_candle_session_attribute_t { dxf_csa_any, dxf_csa_regular, dxf_csa_count, dxf_csa_default = dxf_csa_any }
 Candle session attribute.
 
enum  dxf_candle_type_period_attribute_t {
  dxf_ctpa_tick, dxf_ctpa_second, dxf_ctpa_minute, dxf_ctpa_hour,
  dxf_ctpa_day, dxf_ctpa_week, dxf_ctpa_month, dxf_ctpa_optexp,
  dxf_ctpa_year, dxf_ctpa_volume, dxf_ctpa_price, dxf_ctpa_price_momentum,
  dxf_ctpa_price_renko, dxf_ctpa_count, dxf_ctpa_default = dxf_ctpa_tick
}
 Candle type period attribute.
 
enum  dxf_candle_alignment_attribute_t { dxf_caa_midnight, dxf_caa_session, dxf_caa_count, dxf_caa_default = dxf_caa_midnight }
 Candle alignment attribute.
 
enum  dxf_event_flag {
  dxf_ef_tx_pending = 0x01, dxf_ef_remove_event = 0x02, dxf_ef_snapshot_begin = 0x04, dxf_ef_snapshot_end = 0x08,
  dxf_ef_snapshot_snip = 0x10, dxf_ef_remove_symbol = 0x20
}
 Event flag.
 
enum  dx_subscription_type_t {
  dx_st_begin = 0, dx_st_ticker = dx_st_begin, dx_st_stream, dx_st_history,
  dx_st_count
}
 Subscription type.
 

Functions

dxf_const_string_t dx_event_type_to_string (int event_type)
 Converts event type code to its string representation. More...
 
int dx_get_event_data_struct_size (int event_id)
 Get event data structure size for given event id. More...
 
dx_event_id_t dx_get_event_id_by_bitmask (int event_bitmask)
 Get event id by event bitmask. More...
 
size_t dx_get_event_subscription_params (dxf_connection_t connection, dx_order_source_array_ptr_t order_source, dx_event_id_t event_id, dx_event_subscr_flag subscr_flags, OUT dx_event_subscription_param_list_t *params)
 Returns the list of subscription params. Fills records list according to event_id. More...
 
const dxf_event_data_t dx_get_event_data_item (int event_mask, dxf_const_event_data_t data, size_t index)
 Get event data item from event data. More...
 

Detailed Description

dxFeed C API event data structures declarations

Typedef Documentation

◆ dxf_snapshot_inc_listener_t

typedef void(* dxf_snapshot_inc_listener_t) (const dxf_snapshot_data_ptr_t snapshot_data, int new_snapshot, void *user_data)

Incremental Snapshot listener prototype.

Parameters
[in]snapshot_dataPointer to the received snapshot data
[in]new_snapshotFlag, is this call with new snapshot or incremental update.
[in]user_dataPointer to user struct, use NULL by default

Enumeration Type Documentation

◆ dx_event_subscr_flag

Event Subscription flags

Enumerator
dx_esf_default 

Used for default subscription.

dx_esf_single_record 

Used for subscribing on one record only in case of snapshots.

dx_esf_sr_market_maker_order 

Used with dx_esf_single_record flag and for dx_eid_order (Order) event.

dx_esf_time_series 

Used for time series subscription.

dx_esf_quotes_regional 

Used for regional quotes.

dx_esf_wildcard 

Used for wildcard ("*") subscription.

dx_esf_force_ticker 

Used for forcing subscription to ticker data.

dx_esf_force_stream 

Used for forcing subscription to stream data.

dx_esf_force_history 

Used for forcing subscription to history data.