Trading API for C
7.0.0.309536
|
Functions | |
ctl_trade * | ctl_channel_create_trade (ctl_provider *provider, ctl_channel *channel, const char *model) |
Create a trade on the specified trade channel. More... | |
ctl_trade * | ctl_channel_create_trade_with_requestid (ctl_provider *provider, ctl_channel *channel, const char *model, const char *id) |
Create a trade on the specified trade channel. More... | |
ctl_provider * | ctl_create_ds_client_provider (int num_models, const char *const *models) |
Create a DataSource client Trading provider. More... | |
ctl_provider * | ctl_create_sl_provider (streamlink *sl, int num_models, const char *const *models) |
Create a StreamLink trading provider. More... | |
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. More... | |
void | ctl_provider_set_application_listener (ctl_provider *provider, ctl_app_listener *listener, void *context) |
Set the application listener for the supplied provider. More... | |
Trading clients are usually StreamLink client applications that submit trades for an individual user.
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_trade* ctl_channel_create_trade_with_requestid | ( | ctl_provider * | provider, |
ctl_channel * | channel, | ||
const char * | model, | ||
const char * | id | ||
) |
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. |
id | - The request id of the trade. |
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 |
The subject will usually be in the form /PRIVATE/TRADE for StreamLink applications and /PRIVATE/username/TRADE for DataSource client Adapters.,
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 |
Should a trading channel not be established (due to a Trading adapter not being connected), then the channel_closed() method of the interface will be invoked.