Trading API for C
7.0.0.309536
|
Data Structures | |
struct | ctl_app_listener |
Listener interface that should be registered to receive notification of tradechannel creation and closing. More... | |
Typedefs | |
typedef void(* | ctl_audit_log_cb) (void *ctx, ctl_provider *provider, const char *id, ctl_trade *trade, ctl_tradeevent *ev) |
Definition of the function that you should implement to receive audit logging. More... | |
Functions | |
ctl_provider * | ctl_create_ds_provider (ctl_app_listener *listener, void *context, int num_models, const char *const *models, const char *namespacePattern) |
Create a DataSource trading provider. More... | |
void | ctl_provider_set_audit_dslog (ctl_provider *provider, ds_log_t *log) |
Set the logfile that audit logs will be written to. More... | |
void | ctl_provider_set_audit_logger (ctl_provider *provider, ctl_audit_log_cb callback, void *ctx) |
Set the callback function for the audit logger. More... | |
void | ctl_provider_set_use_generic_messages (ctl_provider *provider, int use_generic_messages) |
Set whether the Trading provider will use generic messages. More... | |
The purpose of a Trading Integration Adapter is to integrate between the Caplin Platform and an arbitrary 3rd party trading system.
Integration Adapters are built in C/C++ using the Datasource SDK, the Trading API interfaces with DSDK and permits you to develop Trading adapters without needing to know about messaging.
The name of the library containing the implementation of the Trading API for DataSource applications is libtrading_ds.a
on Linux/MacOSX and TradingDS.lib/TradingDS.dll
on Windows.
You need to compile your code with the macro HAVE_DSDK to ensure that the DataSource version of the Trading API is available.
Below is an example Trading adapter that demonstrates one way to interface with the Trading API.
typedef void(* ctl_audit_log_cb) (void *ctx, ctl_provider *provider, const char *id, ctl_trade *trade, ctl_tradeevent *ev) |
Definition of the function that you should implement to receive audit logging.
ctx | - Your context (registered with ctl_provider_set_audit_logger()) |
provider | - The trading provider |
id | - A textual representation of what has happened |
trade | - The trade to which this audit event pertains |
ev | - The trade event that stimulated this audit event |
ctl_provider* ctl_create_ds_provider | ( | ctl_app_listener * | listener, |
void * | context, | ||
int | num_models, | ||
const char *const * | models, | ||
const char * | namespacePattern | ||
) |
Create a DataSource trading provider.
listener | - The application listener that will receive notification of trade channel opens and closes. |
context | - A callback context for the listener parameter |
num_models | - Number of trade model files to read |
models | - An array of XML files that contain trademodel definitions |
namespacePattern | - The pattern that matches trade channels |
The namespacePattern should include a %u to indicate the position of the username, for example: "/TRADE/%u/CHANNEL".
void ctl_provider_set_audit_dslog | ( | ctl_provider * | provider, |
ds_log_t * | log | ||
) |
Set the logfile that audit logs will be written to.
provider | - The trading provider |
log | - The DataSource logfile that audit logs will be written to |
void ctl_provider_set_audit_logger | ( | ctl_provider * | provider, |
ctl_audit_log_cb | callback, | ||
void * | ctx | ||
) |
Set the callback function for the audit logger.
provider | - The trading provider |
callback | - Callback that will be invoked when an audit event is generated |
ctx | - Callback context |
void ctl_provider_set_use_generic_messages | ( | ctl_provider * | provider, |
int | use_generic_messages | ||
) |
Set whether the Trading provider will use generic messages.
provider | - The Trading provider |
use_generic_messages | - Non zero if generic messages should be used |
Generic messages do not require field configuration or extra configuration in the Liberator to disable throttling. In general it is recommended that they are used.
This function should be called before the first trade channel has been been opened, that is prior to the ds_loop() call in your Adapter.