Functions | |
void | ctl_provider_set_application_listener (ctl_provider *provider, ctl_app_listener *listener, void *context) |
Set the application listener for the supplied provider. | |
ctl_provider * | ctl_create_ds_client_provider (int num_models, const char *const *models) |
Create a DataSource client Trading provider. | |
ctl_channel * | ctl_provider_create_channel (ctl_provider *provider, const char *subject, ctl_channel_listener *listener, void *context) |
Create a trade channel using the supplied provider. | |
ctl_trade * | ctl_channel_create_trade (ctl_provider *provider, ctl_channel *channel, const char *model) |
Create a trade on the specified trade channel. | |
ctl_provider * | ctl_create_sl_provider (streamlink *sl, int num_models, const char *const *models) |
Create a StreamLink trading provider. |
The name of the library containing the implementation of the Trading API for StreamLink applications is libtrading_sl.a
on Linux/MacOSX and TradingSL.lib/TradingSL.dll
on Windows.
You need to compile your code with the macro HAVE_STREAMLINK to ensure that the StreamLink version of the Trading API is available.
For the purposes of testing (in particular load testing), it can be useful to build a DataSource adapter that simulates trades by many clients, as a result the Trading API library permits this functionality to be built.
For this case the libtrading_ds.a
library should be used and the following compilation macros defined prior to include ctl.h
: -DHAVE_DSDK -DHAVE_CLIENT_API
.
ctl_trade* ctl_channel_create_trade | ( | ctl_provider * | provider, | |
ctl_channel * | channel, | |||
const char * | model | |||
) |
Create a trade on the specified trade channel.
provider | - The trading provider. | |
channel | - The trade channel to create the trade on. | |
model | - The trade model of the trade to create. |
ctl_provider* ctl_create_ds_client_provider | ( | int | num_models, | |
const char *const * | models | |||
) |
Create a DataSource client Trading provider.
num_models | - Number of trade model files to read | |
models | - An array of XML files that contain trademodel definitions |
ctl_provider* ctl_create_sl_provider | ( | streamlink * | sl, | |
int | num_models, | |||
const char *const * | models | |||
) |
Create a StreamLink trading provider.
sl | - The StreamLink instance to send messages on | |
num_models | - Number of trade model files to read | |
models | - An array of XML files that contain trademodel definitions |
ctl_channel* ctl_provider_create_channel | ( | ctl_provider * | provider, | |
const char * | subject, | |||
ctl_channel_listener * | listener, | |||
void * | context | |||
) |
Create a trade channel using the supplied provider.
provider | - The StreamLink provide on which to create the channel. | |
subject | - The subject of the trade channel | |
listener | - The listener to call | |
context | - A context pointer for the listener |
void ctl_provider_set_application_listener | ( | ctl_provider * | provider, | |
ctl_app_listener * | listener, | |||
void * | context | |||
) |
Set the application listener for the supplied provider.
provider | - The Trading provider | |
listener | - The application listener that will receive notification of trade channel opens and closes. | |
context | - A callback context for the listener parameter |