dxFeed C API  6.0.1
dxFeed C API library intended to provide market data access for DX clients
Typedefs | Functions
Snapshots

Snapshot functions. More...

Collaboration diagram for Snapshots:

Typedefs

typedef void(* dxf_snapshot_listener_t) (const dxf_snapshot_data_ptr_t snapshot_data, void *user_data)
 Snapshot listener prototype. More...
 

Functions

DXFEED_API ERRORCODE dxf_create_snapshot (dxf_connection_t connection, dx_event_id_t event_id, dxf_const_string_t symbol, const char *source, dxf_long_t time, OUT dxf_snapshot_t *snapshot)
 Creates snapshot with the specified parameters. More...
 
DXFEED_API ERRORCODE dxf_create_order_snapshot (dxf_connection_t connection, dxf_const_string_t symbol, const char *source, dxf_long_t time, OUT dxf_snapshot_t *snapshot)
 Creates Order snapshot with the specified parameters. More...
 
DXFEED_API ERRORCODE dxf_create_candle_snapshot (dxf_connection_t connection, dxf_candle_attributes_t candle_attributes, dxf_long_t time, OUT dxf_snapshot_t *snapshot)
 Creates Candle snapshot with the specified parameters. More...
 
DXFEED_API ERRORCODE dxf_close_snapshot (dxf_snapshot_t snapshot)
 Closes a snapshot. More...
 
DXFEED_API ERRORCODE dxf_attach_snapshot_listener (dxf_snapshot_t snapshot, dxf_snapshot_listener_t snapshot_listener, void *user_data)
 Attaches a listener callback to the snapshot. More...
 
DXFEED_API ERRORCODE dxf_detach_snapshot_listener (dxf_snapshot_t snapshot, dxf_snapshot_listener_t snapshot_listener)
 Detaches a listener from the snapshot. More...
 
DXFEED_API ERRORCODE dxf_attach_snapshot_inc_listener (dxf_snapshot_t snapshot, dxf_snapshot_inc_listener_t snapshot_listener, void *user_data)
 Attaches an incremental listener callback to the snapshot. More...
 
DXFEED_API ERRORCODE dxf_detach_snapshot_inc_listener (dxf_snapshot_t snapshot, dxf_snapshot_inc_listener_t snapshot_listener)
 Detaches a listener from the snapshot. More...
 
DXFEED_API ERRORCODE dxf_get_snapshot_symbol (dxf_snapshot_t snapshot, OUT dxf_string_t *symbol)
 Retrieves the symbol currently added to the snapshot subscription. More...
 

Detailed Description

Snapshot functions.

Typedef Documentation

◆ dxf_snapshot_listener_t

typedef void(* dxf_snapshot_listener_t) (const dxf_snapshot_data_ptr_t snapshot_data, void *user_data)

Snapshot listener prototype.

Parameters
[in]snapshot_dataPointer to the received snapshot data
[in]user_dataPointer to user struct, use NULL by default

Function Documentation

◆ dxf_attach_snapshot_inc_listener()

DXFEED_API ERRORCODE dxf_attach_snapshot_inc_listener ( dxf_snapshot_t  snapshot,
dxf_snapshot_inc_listener_t  snapshot_listener,
void *  user_data 
)

Attaches an incremental listener callback to the snapshot.

This callback will be invoked when the new snapshot arrives or existing updates. No error occurs if it's attempted to attach the same listener twice or more.

Parameters
[in]snapshotA handle of the snapshot to which a listener is to be attached
[in]snapshot_listenerA listener callback function pointer
[in]user_dataData to be passed to the callback function
Returns
DXF_SUCCESS if listener has been successfully attached or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_attach_snapshot_listener()

DXFEED_API ERRORCODE dxf_attach_snapshot_listener ( dxf_snapshot_t  snapshot,
dxf_snapshot_listener_t  snapshot_listener,
void *  user_data 
)

Attaches a listener callback to the snapshot.

This callback will be invoked when the new snapshot arrives or existing updates. No error occurs if it's attempted to attach the same listener twice or more.

Parameters
[in]snapshotA handle of the snapshot to which a listener is to be attached
[in]snapshot_listenerA listener callback function pointer
[in]user_dataData to be passed to the callback function
Returns
DXF_SUCCESS if snapshot listener has been successfully attached or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_close_snapshot()

DXFEED_API ERRORCODE dxf_close_snapshot ( dxf_snapshot_t  snapshot)

Closes a snapshot.

All the data associated with it will be freed.

Parameters
[in]snapshotA handle of the snapshot to close
Returns
DXF_SUCCESS if snapshot has been closed successfully or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_create_candle_snapshot()

DXFEED_API ERRORCODE dxf_create_candle_snapshot ( dxf_connection_t  connection,
dxf_candle_attributes_t  candle_attributes,
dxf_long_t  time,
OUT dxf_snapshot_t snapshot 
)

Creates Candle snapshot with the specified parameters.

Parameters
[in]connectionA handle of a previously created connection which the subscription will be using
[in]candle_attributesObject specified symbol attributes of candle
[in]timeTime in the past (unix time in milliseconds)
[out]snapshotA handle of the created snapshot
Returns
DXF_SUCCESS if candle snapshot has been successfully created or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; newly created snapshot is return via snapshot output parameter

◆ dxf_create_order_snapshot()

DXFEED_API ERRORCODE dxf_create_order_snapshot ( dxf_connection_t  connection,
dxf_const_string_t  symbol,
const char *  source,
dxf_long_t  time,
OUT dxf_snapshot_t snapshot 
)

Creates Order snapshot with the specified parameters.

If source is NULL string subscription on Order event will be performed. You can specify order source for Order event by passing suffix: "BYX", "BZX", "DEA", "DEX", "ISE", "IST", "NTV" etc. If source is equal to "AGGREGATE_BID" or "AGGREGATE_ASK" subscription on MarketMaker event will be performed.

Parameters
[in]connectionA handle of a previously created connection which the subscription will be using
[in]symbolThe symbol to add
[in]sourceOrder source for Order, which can be one of following: "NTV", "ntv", "NFX", "ESPD", "XNFI", "ICE", "ISE", "DEA", "DEX", "BYX", "BZX", "BATE", "CHIX", "CEUX", "BXTR", "IST", "BI20", "ABE", "FAIR", "GLBX", "glbx", "ERIS", "XEUR", "xeur", "CFE", "C2OX", "SMFE". For MarketMaker subscription use "AGGREGATE_BID" or "AGGREGATE_ASK" keyword.
[in]timeTime in the past (unix time in milliseconds)
[out]snapshotA handle of the created snapshot
Returns
DXF_SUCCESS if order snapshot has been successfully created or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; newly created snapshot is return via snapshot output parameter

◆ dxf_create_snapshot()

DXFEED_API ERRORCODE dxf_create_snapshot ( dxf_connection_t  connection,
dx_event_id_t  event_id,
dxf_const_string_t  symbol,
const char *  source,
dxf_long_t  time,
OUT dxf_snapshot_t snapshot 
)

Creates snapshot with the specified parameters.

For Order or Candle events (dx_eid_order or dx_eid_candle) please use short form of this function: dxf_create_order_snapshot or dxf_create_candle_snapshot respectively.

For order events (event_id is 'dx_eid_order') If source is NULL string subscription on Order event will be performed. You can specify order source for Order event by passing suffix: "BYX", "BZX", "DEA", "DEX", "ISE", "IST", "NTV" etc. If source is equal to "AGGREGATE_BID" or "AGGREGATE_ASK" subscription on MarketMaker event will be performed. For other events source parameter does not matter.

Parameters
[in]connectionA handle of a previously created connection which the subscription will be using
[in]event_idSingle event id. Next events is supported: dxf_eid_order, dxf_eid_candle, dx_eid_spread_order, dx_eid_time_and_sale, dx_eid_greeks, dx_eid_series.
[in]symbolThe symbol to add.
[in]sourceOrder source for Order, which can be one of following: "NTV", "ntv", "NFX", "ESPD", "XNFI", "ICE", "ISE", "DEA", "DEX", "BYX", "BZX", "BATE", "CHIX", "CEUX", "BXTR", "IST", "BI20", "ABE", "FAIR", "GLBX", "glbx", "ERIS", "XEUR", "xeur", "CFE", "C2OX", "SMFE". For MarketMaker subscription use "AGGREGATE_BID" or "AGGREGATE_ASK" keyword.
[in]timeTime in the past (unix time in milliseconds).
[out]snapshotA handle of the created snapshot
Returns
DXF_SUCCESS if snapshot has been successfully created or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; newly created snapshot is return via snapshot output parameter

◆ dxf_detach_snapshot_inc_listener()

DXFEED_API ERRORCODE dxf_detach_snapshot_inc_listener ( dxf_snapshot_t  snapshot,
dxf_snapshot_inc_listener_t  snapshot_listener 
)

Detaches a listener from the snapshot.

No error occurs if it's attempted to detach a listener which wasn't previously attached.

Parameters
[in]snapshotA handle of the snapshot to which a listener is to be detached
[in]snapshot_listenerA listener callback function pointer
Returns
DXF_SUCCESS if snapshot listener has been successfully detached or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_detach_snapshot_listener()

DXFEED_API ERRORCODE dxf_detach_snapshot_listener ( dxf_snapshot_t  snapshot,
dxf_snapshot_listener_t  snapshot_listener 
)

Detaches a listener from the snapshot.

No error occurs if it's attempted to detach a listener which wasn't previously attached.

Parameters
[in]snapshotA handle of the snapshot to which a listener is to be detached
[in]snapshot_listenerA listener callback function pointer
Returns
DXF_SUCCESS if snapshot listener has been successfully detached or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure;

◆ dxf_get_snapshot_symbol()

DXFEED_API ERRORCODE dxf_get_snapshot_symbol ( dxf_snapshot_t  snapshot,
OUT dxf_string_t symbol 
)

Retrieves the symbol currently added to the snapshot subscription.

The memory for the resulting symbol is allocated internally, so no actions to free it are required.

Parameters
[in]snapshotA handle of the snapshot to which a listener is to be detached
[out]symbolA pointer to the string object to which the symbol is to be stored
Returns
DXF_SUCCESS if snapshot symbol has been successfully received or DXF_FAILURE on error; dxf_get_last_error can be used to retrieve the error code and description in case of failure; symbol itself is returned via out parameter