LongPort OpenAPI C SDK
|
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | LB_SUBFLAGS_QUOTE 1 |
#define | LB_SUBFLAGS_DEPTH 2 |
#define | LB_SUBFLAGS_BROKER 4 |
#define | LB_SUBFLAGS_TRADE 8 |
#define | LB_DERIVATIVE_TYPE_OPTION 1 |
#define | LB_DERIVATIVE_TYPE_WARRANT 2 |
#define | LB_WATCHLIST_GROUP_NAME 1 |
#define | LB_WATCHLIST_GROUP_SECURITIES 2 |
Functions | |
struct lb_config_t * | lb_config_from_env (struct lb_error_t **error) |
struct lb_config_t * | lb_config_new (const char *app_key, const char *app_secret, const char *access_token, const char *http_url, const char *quote_ws_url, const char *trade_ws_url, const enum lb_language_t *language, bool enable_overight, const enum lb_push_candlestick_mode_t *push_candlestick_mode, bool enable_print_quote_packages, const char *log_path) |
void | lb_config_free (struct lb_config_t *config) |
void | lb_config_refresh_access_token (struct lb_config_t *config, int64_t expired_at, lb_async_callback_t callback, void *userdata) |
void | lb_error_free (struct lb_error_t *error) |
const char * | lb_error_message (const struct lb_error_t *error) |
int64_t | lb_error_code (const struct lb_error_t *error) |
struct lb_http_client_t * | lb_http_client_new (const char *http_url, const char *app_key, const char *app_secret, const char *access_token) |
void | lb_http_client_free (struct lb_http_client_t *http_client) |
struct lb_http_client_t * | lb_http_client_from_env (struct lb_error_t **error) |
void | lb_http_client_request (struct lb_http_client_t *http_client, const char *method, const char *path, const struct lb_http_header_t *headers, const char *request_body, lb_async_callback_t callback, void *userdata) |
void | lb_http_result_free (struct lb_http_result_t *http_result) |
const char * | lb_http_result_response_body (const struct lb_http_result_t *http_result) |
void | lb_quote_context_new (const struct lb_config_t *config, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_retain (const struct lb_quote_context_t *ctx) |
void | lb_quote_context_release (const struct lb_quote_context_t *ctx) |
uintptr_t | lb_quote_context_ref_count (const struct lb_quote_context_t *ctx) |
void | lb_quote_context_set_userdata (const struct lb_quote_context_t *ctx, void *userdata) |
void * | lb_quote_context_userdata (const struct lb_quote_context_t *ctx) |
void | lb_quote_context_set_free_userdata_func (const struct lb_quote_context_t *ctx, lb_free_userdata_func_t f) |
int64_t | lb_quote_context_member_id (const struct lb_quote_context_t *ctx) |
const char * | lb_quote_context_quote_level (const struct lb_quote_context_t *ctx) |
void | lb_quote_context_quote_package_details (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_set_on_quote (const struct lb_quote_context_t *ctx, lb_quote_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_quote_context_set_on_depth (const struct lb_quote_context_t *ctx, lb_depth_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_quote_context_set_on_brokers (const struct lb_quote_context_t *ctx, lb_brokers_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_quote_context_set_on_trades (const struct lb_quote_context_t *ctx, lb_trades_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_quote_context_set_on_candlestick (const struct lb_quote_context_t *ctx, lb_candlestick_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_quote_context_subscribe (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, uint8_t sub_types, bool is_first_push, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_unsubscribe (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, uint8_t sub_types, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_subscribe_candlesticks (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_unsubscribe_candlesticks (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_subscrptions (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_static_info (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_quote (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_option_quote (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_warrant_quote (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_depth (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_brokers (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_participants (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_trades (const struct lb_quote_context_t *ctx, const char *symbol, uintptr_t count, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_intraday (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_candlesticks (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, uintptr_t count, enum lb_adjust_type_t adjust_type, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_history_candlesticks_by_offset (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, enum lb_adjust_type_t adjust_type, bool forward, const struct lb_datetime_t *time, uintptr_t count, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_history_candlesticks_by_date (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, enum lb_adjust_type_t adjust_type, const struct lb_date_t *start, const struct lb_date_t *end, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_option_chain_expiry_date_list (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_option_chain_info_by_date (const struct lb_quote_context_t *ctx, const char *symbol, const struct lb_date_t *expiry_date, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_warrant_issuers (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_warrant_list (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_warrant_sort_by_t sort_by, enum lb_sort_order_type_t sort_order, const enum lb_warrant_type_t *warrant_type, uintptr_t num_warrant_type, const int32_t *issuer, uintptr_t num_issuer, const enum lb_filter_warrant_expiry_date_t *expiry_date, uintptr_t num_expiry_date, const enum lb_filter_warrant_in_out_bounds_type_t *price_type, uintptr_t num_price_type, const enum lb_warrant_status_t *status, uintptr_t num_status, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_trading_session (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_trading_days (const struct lb_quote_context_t *ctx, enum lb_market_t market, const struct lb_date_t *begin, const struct lb_date_t *end, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_capital_flow (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_capital_distribution (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_calc_indexes (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, const enum lb_calc_index_t *indexes, uintptr_t num_indexes, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_watchlist (const struct lb_quote_context_t *ctx, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_create_watchlist_group (const struct lb_quote_context_t *ctx, const struct lb_create_watchlist_group_t *req, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_delete_watchlist_group (const struct lb_quote_context_t *ctx, int64_t id, bool purge, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_update_watchlist_group (const struct lb_quote_context_t *ctx, const struct lb_update_watchlist_group_t *req, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_realtime_quote (const struct lb_quote_context_t *ctx, const char *const *symbols, uintptr_t num_symbols, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_realtime_depth (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_realtime_trades (const struct lb_quote_context_t *ctx, const char *symbol, uintptr_t count, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_realtime_brokers (const struct lb_quote_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_realtime_candlesticks (const struct lb_quote_context_t *ctx, const char *symbol, enum lb_period_t period, uintptr_t count, lb_async_callback_t callback, void *userdata) |
void | lb_quote_context_security_list (const struct lb_quote_context_t *ctx, enum lb_market_t market, enum lb_security_list_category_t category, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_new (const struct lb_config_t *config, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_retain (const struct lb_trade_context_t *ctx) |
void | lb_trade_context_release (const struct lb_trade_context_t *ctx) |
uintptr_t | lb_trade_context_ref_count (const struct lb_trade_context_t *ctx) |
void | lb_trade_context_set_userdata (const struct lb_trade_context_t *ctx, void *userdata) |
void * | lb_trade_context_userdata (const struct lb_trade_context_t *ctx) |
void | lb_trade_context_set_free_userdata_func (const struct lb_trade_context_t *ctx, lb_free_userdata_func_t f) |
void | lb_trade_context_set_on_order_changed (const struct lb_trade_context_t *ctx, lb_order_changed_callback_t callback, void *userdata, lb_free_userdata_func_t free_userdata) |
void | lb_trade_context_subscribe (const struct lb_trade_context_t *ctx, const enum lb_topic_type_t *topics, uintptr_t num_topics, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_unsubscribe (const struct lb_trade_context_t *ctx, const enum lb_topic_type_t *topics, uintptr_t num_topics, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_history_executions (const struct lb_trade_context_t *ctx, const struct lb_get_history_executions_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_today_executions (const struct lb_trade_context_t *ctx, const struct lb_get_today_executions_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_history_orders (const struct lb_trade_context_t *ctx, const struct lb_get_history_orders_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_today_orders (const struct lb_trade_context_t *ctx, const struct lb_get_today_orders_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_replace_order (const struct lb_trade_context_t *ctx, const struct lb_replace_order_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_submit_order (const struct lb_trade_context_t *ctx, const struct lb_submit_order_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_cancel_order (const struct lb_trade_context_t *ctx, const char *order_id, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_account_balance (const struct lb_trade_context_t *ctx, const char *currency, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_cash_flow (const struct lb_trade_context_t *ctx, const struct lb_get_cash_flow_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_fund_positions (const struct lb_trade_context_t *ctx, const struct lb_get_fund_positions_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_stock_positions (const struct lb_trade_context_t *ctx, const struct lb_get_stock_positions_options_t *opts, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_margin_ratio (const struct lb_trade_context_t *ctx, const char *symbol, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_order_detail (const struct lb_trade_context_t *ctx, const char *order_id, lb_async_callback_t callback, void *userdata) |
void | lb_trade_context_estimate_max_purchase_quantity (const struct lb_trade_context_t *ctx, const struct lb_estimate_max_purchase_quantity_options_t *opts, lb_async_callback_t callback, void *userdata) |
struct lb_decimal_t * | lb_decimal_new (int64_t num, uint32_t scale) |
struct lb_decimal_t * | lb_decimal_clone (const struct lb_decimal_t *value) |
struct lb_decimal_t * | lb_decimal_from_str (const char *value) |
struct lb_decimal_t * | lb_decimal_from_double (double value) |
void | lb_decimal_free (struct lb_decimal_t *value) |
double | lb_decimal_to_double (const struct lb_decimal_t *value) |
void | lb_decimal_abs (struct lb_decimal_t *value) |
void | lb_decimal_ceil (struct lb_decimal_t *value) |
void | lb_decimal_floor (struct lb_decimal_t *value) |
void | lb_decimal_fract (struct lb_decimal_t *value) |
bool | lb_decimal_is_negative (const struct lb_decimal_t *value) |
bool | lb_decimal_is_positive (const struct lb_decimal_t *value) |
bool | lb_decimal_is_zero (const struct lb_decimal_t *value) |
const struct lb_decimal_t * | lb_decimal_max (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
const struct lb_decimal_t * | lb_decimal_min (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_normalize (struct lb_decimal_t *value) |
void | lb_decimal_round (struct lb_decimal_t *value) |
void | lb_decimal_round_dp (struct lb_decimal_t *value, uint32_t dp) |
void | lb_decimal_trunc (struct lb_decimal_t *value) |
void | lb_decimal_add (struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_sub (struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_mul (struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_div (struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_rem (struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_neg (struct lb_decimal_t *value) |
bool | lb_decimal_gt (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
bool | lb_decimal_gte (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
bool | lb_decimal_eq (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
bool | lb_decimal_lt (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
bool | lb_decimal_lte (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
int32_t | lb_decimal_cmp (const struct lb_decimal_t *a, const struct lb_decimal_t *b) |
void | lb_decimal_sin (struct lb_decimal_t *value) |
void | lb_decimal_cos (struct lb_decimal_t *value) |
void | lb_decimal_tan (struct lb_decimal_t *value) |
void | lb_decimal_sqrt (struct lb_decimal_t *value) |
void | lb_decimal_pow (struct lb_decimal_t *value, const struct lb_decimal_t *exp) |
void | lb_decimal_ln (struct lb_decimal_t *value) |
void | lb_decimal_log10 (struct lb_decimal_t *value) |
void | lb_decimal_exp (struct lb_decimal_t *value) |
void | lb_decimal_exp_with_tolerance (struct lb_decimal_t *value, const struct lb_decimal_t *tolerance) |
void | lb_decimal_erf (struct lb_decimal_t *value) |
void | lb_decimal_normal_cdf (struct lb_decimal_t *value) |
void | lb_decimal_norm_pdf (struct lb_decimal_t *value) |
const char * | lb_decimal_to_string (const struct lb_decimal_t *value) |
#define LB_DERIVATIVE_TYPE_OPTION 1 |
US stock options
#define LB_DERIVATIVE_TYPE_WARRANT 2 |
HK warrants
#define LB_SUBFLAGS_BROKER 4 |
Broker
#define LB_SUBFLAGS_DEPTH 2 |
Depth
#define LB_SUBFLAGS_QUOTE 1 |
Quote
#define LB_SUBFLAGS_TRADE 8 |
Trade
#define LB_WATCHLIST_GROUP_NAME 1 |
Update name of watchlist group
#define LB_WATCHLIST_GROUP_SECURITIES 2 |
Update securities of watchlist group
typedef struct lb_account_balance_t lb_account_balance_t |
Account balance
typedef enum lb_adjust_type_t lb_adjust_type_t |
Adjust type
typedef void(* lb_async_callback_t) (const struct lb_async_result_t *) |
typedef struct lb_async_result_t lb_async_result_t |
typedef enum lb_balance_type_t lb_balance_type_t |
Balance type
typedef void(* lb_brokers_callback_t) (const struct lb_quote_context_t *, const struct lb_push_brokers_t *, void *) |
typedef struct lb_brokers_t lb_brokers_t |
Brokers
typedef enum lb_calc_index_t lb_calc_index_t |
Calc index
typedef void(* lb_candlestick_callback_t) (const struct lb_quote_context_t *, const struct lb_push_candlestick_t *, void *) |
typedef struct lb_candlestick_t lb_candlestick_t |
Candlestick
Capital distribution response
typedef struct lb_capital_distribution_t lb_capital_distribution_t |
Capital distribution
typedef struct lb_capital_flow_line_t lb_capital_flow_line_t |
Market trading days
typedef enum lb_cash_flow_direction_t lb_cash_flow_direction_t |
Cash flow direction
typedef struct lb_cash_flow_t lb_cash_flow_t |
Cash flow
typedef struct lb_cash_info_t lb_cash_info_t |
Account balance
typedef enum lb_charge_category_code_t lb_charge_category_code_t |
Charge category code
typedef enum lb_commission_free_status_t lb_commission_free_status_t |
Commission-free Status
typedef struct lb_config_t lb_config_t |
Configuration options for LongPort sdk
typedef struct lb_create_watchlist_group_t lb_create_watchlist_group_t |
An request to create a watchlist group
typedef struct lb_datetime_t lb_datetime_t |
typedef struct lb_decimal_t lb_decimal_t |
typedef enum lb_deduction_status_t lb_deduction_status_t |
Deduction status
typedef void(* lb_depth_callback_t) (const struct lb_quote_context_t *, const struct lb_push_depth_t *, void *) |
typedef struct lb_depth_t lb_depth_t |
Depth
typedef struct lb_error_t lb_error_t |
typedef struct lb_estimate_max_purchase_quantity_options_t lb_estimate_max_purchase_quantity_options_t |
Options for estimate maximum purchase quantity
typedef struct lb_estimate_max_purchase_quantity_response_t lb_estimate_max_purchase_quantity_response_t |
Options for estimate maximum purchase quantity
typedef struct lb_execution_t lb_execution_t |
Execution
Filter warrant expiry date type
Filter warrant in/out of the bounds type
typedef void(* lb_free_userdata_func_t) (void *) |
typedef struct lb_fund_position_channel_t lb_fund_position_channel_t |
Fund position channel
typedef struct lb_fund_position_response_t lb_fund_position_response_t |
Fund positions response
typedef struct lb_fund_position_t lb_fund_position_t |
Fund position
typedef struct lb_get_cash_flow_options_t lb_get_cash_flow_options_t |
Options for get cash flow request
typedef struct lb_get_fund_positions_options_t lb_get_fund_positions_options_t |
Options for get fund positions request
Options for get histroy executions request
typedef struct lb_get_history_orders_options_t lb_get_history_orders_options_t |
Options for get history orders request
typedef struct lb_get_stock_positions_options_t lb_get_stock_positions_options_t |
Options for get stock positions request
Options for get today executions request
typedef struct lb_get_today_orders_options_t lb_get_today_orders_options_t |
Options for get today orders request
typedef struct lb_http_client_t lb_http_client_t |
A HTTP client for LongPort OpenApi
typedef struct lb_http_header_t lb_http_header_t |
HTTP Header
typedef struct lb_http_result_t lb_http_result_t |
typedef struct lb_intraday_line_t lb_intraday_line_t |
Intraday line
typedef struct lb_issuer_info_t lb_issuer_info_t |
Issuer info
typedef enum lb_language_t lb_language_t |
Language identifer
typedef struct lb_margin_ratio_t lb_margin_ratio_t |
Margin ratio
typedef enum lb_market_t lb_market_t |
Market type
typedef struct lb_market_trading_days_t lb_market_trading_days_t |
Market trading days
typedef struct lb_market_trading_session_t lb_market_trading_session_t |
Market trading session
typedef enum lb_option_direction_t lb_option_direction_t |
Option direction
typedef struct lb_option_quote_t lb_option_quote_t |
Quote of option
typedef enum lb_option_type_t lb_option_type_t |
Option type
typedef void(* lb_order_changed_callback_t) (const struct lb_trade_context_t *, const struct lb_push_order_changed_t *, void *) |
typedef struct lb_order_charge_detail_t lb_order_charge_detail_t |
Order charge detail
typedef struct lb_order_charge_fee_t lb_order_charge_fee_t |
Order charge fee
typedef struct lb_order_charge_item_t lb_order_charge_item_t |
Order charge item
typedef struct lb_order_detail_t lb_order_detail_t |
Order detail
typedef struct lb_order_history_detail_t lb_order_history_detail_t |
Order detail
typedef enum lb_order_side_t lb_order_side_t |
Order side
typedef enum lb_order_status_t lb_order_status_t |
Order status
typedef struct lb_order_t lb_order_t |
Order
typedef enum lb_order_tag_t lb_order_tag_t |
Order tag
typedef enum lb_order_type_t lb_order_type_t |
Order type
typedef enum lb_outside_rth_t lb_outside_rth_t |
Enable or disable outside regular trading hours
typedef struct lb_participant_info_t lb_participant_info_t |
Participant info
typedef enum lb_period_t lb_period_t |
Candlestick period
typedef struct lb_prepost_quote_t lb_prepost_quote_t |
Quote of US pre/post market
typedef struct lb_push_brokers_t lb_push_brokers_t |
Brokers message
typedef enum lb_push_candlestick_mode_t lb_push_candlestick_mode_t |
Language identifer
typedef struct lb_push_candlestick_t lb_push_candlestick_t |
Candlestick updated message
typedef struct lb_push_depth_t lb_push_depth_t |
Quote message
typedef struct lb_push_order_changed_t lb_push_order_changed_t |
Order changed message
typedef struct lb_push_quote_t lb_push_quote_t |
Quote message
typedef struct lb_push_trades_t lb_push_trades_t |
Trades message
typedef void(* lb_quote_callback_t) (const struct lb_quote_context_t *, const struct lb_push_quote_t *, void *) |
typedef struct lb_quote_context_t lb_quote_context_t |
Quote context
typedef struct lb_quote_package_detail_t lb_quote_package_detail_t |
Security
typedef struct lb_realtime_quote_t lb_realtime_quote_t |
Real-time quote
typedef struct lb_replace_order_options_t lb_replace_order_options_t |
Options for replace order request
typedef enum lb_securities_update_mode_t lb_securities_update_mode_t |
Trade session
typedef enum lb_security_board_t lb_security_board_t |
Adjust type
typedef struct lb_security_brokers_t lb_security_brokers_t |
Security brokers
typedef struct lb_security_calc_index_t lb_security_calc_index_t |
Security calc index response
typedef struct lb_security_depth_t lb_security_depth_t |
Quote message
typedef enum lb_security_list_category_t lb_security_list_category_t |
Security list category
typedef struct lb_security_quote_t lb_security_quote_t |
Quote of securitity
typedef struct lb_security_static_info_t lb_security_static_info_t |
The basic information of securities
typedef struct lb_security_t lb_security_t |
Security
typedef enum lb_sort_order_type_t lb_sort_order_type_t |
Sort order type
typedef struct lb_stock_position_channel_t lb_stock_position_channel_t |
Stock position channel
typedef struct lb_stock_position_response_t lb_stock_position_response_t |
Stock positions response
typedef struct lb_stock_position_t lb_stock_position_t |
Stock position
typedef struct lb_strike_price_info_t lb_strike_price_info_t |
Strike price info
typedef struct lb_submit_order_options_t lb_submit_order_options_t |
Options for submit order request
typedef struct lb_submit_order_response_t lb_submit_order_response_t |
Response for submit order request
typedef struct lb_subscription_t lb_subscription_t |
typedef enum lb_time_in_force_type_t lb_time_in_force_type_t |
Time in force Type
typedef enum lb_topic_type_t lb_topic_type_t |
Topic type
typedef struct lb_trade_context_t lb_trade_context_t |
Trade context
typedef enum lb_trade_direction_t lb_trade_direction_t |
Trade direction
typedef enum lb_trade_session_t lb_trade_session_t |
Trade session
typedef enum lb_trade_status_t lb_trade_status_t |
Trade status
typedef struct lb_trade_t lb_trade_t |
Trade
typedef void(* lb_trades_callback_t) (const struct lb_quote_context_t *, const struct lb_push_trades_t *, void *) |
typedef struct lb_trading_session_info_t lb_trading_session_info_t |
The information of trading session
typedef enum lb_trigger_status_t lb_trigger_status_t |
Order tag
typedef struct lb_update_watchlist_group_t lb_update_watchlist_group_t |
An request to update a watchlist group
typedef struct lb_warrant_info_t lb_warrant_info_t |
Warrant info
typedef struct lb_warrant_quote_t lb_warrant_quote_t |
Quote of warrant
typedef enum lb_warrant_sort_by_t lb_warrant_sort_by_t |
Warrant sort by
typedef enum lb_warrant_status_t lb_warrant_status_t |
Warrant status
typedef enum lb_warrant_type_t lb_warrant_type_t |
Warrant type
typedef struct lb_watchlist_group_t lb_watchlist_group_t |
Watchlist group
typedef struct lb_watchlist_security_t lb_watchlist_security_t |
Watchlist security
enum lb_adjust_type_t |
enum lb_balance_type_t |
enum lb_calc_index_t |
Calc index
enum lb_language_t |
enum lb_market_t |
enum lb_option_type_t |
enum lb_order_side_t |
enum lb_order_status_t |
Order status
enum lb_order_tag_t |
Order tag
enum lb_order_type_t |
Order type
enum lb_outside_rth_t |
enum lb_period_t |
Candlestick period
enum lb_security_board_t |
Adjust type
enum lb_sort_order_type_t |
enum lb_topic_type_t |
enum lb_trade_direction_t |
enum lb_trade_session_t |
enum lb_trade_status_t |
Trade status
enum lb_trigger_status_t |
enum lb_warrant_sort_by_t |
Warrant sort by
enum lb_warrant_status_t |
enum lb_warrant_type_t |
void lb_config_free | ( | struct lb_config_t * | config | ) |
Free the config object
struct lb_config_t* lb_config_from_env | ( | struct lb_error_t ** | error | ) |
Create a new Config
from the given environment variables
It first gets the environment variables from the .env
file in the current directory.
LONGPORT_APP_KEY
- App keyLONGPORT_APP_SECRET
- App secretLONGPORT_ACCESS_TOKEN
- Access tokenLONGPORT_HTTP_URL
- HTTP endpoint url (Default: https://openapi.longportapp.com
)LONGPORT_QUOTE_WS_URL
- Quote websocket endpoint url (Default: wss://openapi-quote.longportapp.com/v2
)LONGPORT_TRADE_WS_URL
- Trade websocket endpoint url (Default: wss://openapi-trade.longportapp.com/v2
)LONGPORT_ENABLE_OVERNIGHT
- Enable overnight quote, true
or false
(Default: false
)LONGPORT_PUSH_CANDLESTICK_MODE
- realtime
or confirmed
(Default: realtime
)LONGPORT_PRINT_QUOTE_PACKAGES
- Print quote packages when connected, true
or false
(Default: true
)LONGPORT_LOG_PATH
- Set the path of the log files (Default: no logs
) struct lb_config_t* lb_config_new | ( | const char * | app_key, |
const char * | app_secret, | ||
const char * | access_token, | ||
const char * | http_url, | ||
const char * | quote_ws_url, | ||
const char * | trade_ws_url, | ||
const enum lb_language_t * | language, | ||
bool | enable_overight, | ||
const enum lb_push_candlestick_mode_t * | push_candlestick_mode, | ||
bool | enable_print_quote_packages, | ||
const char * | log_path | ||
) |
void lb_config_refresh_access_token | ( | struct lb_config_t * | config, |
int64_t | expired_at, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Gets a new access_token
void lb_decimal_abs | ( | struct lb_decimal_t * | value | ) |
Computes the absolute value.
void lb_decimal_add | ( | struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Performs the +
operation.
void lb_decimal_ceil | ( | struct lb_decimal_t * | value | ) |
Returns the smallest integer greater than or equal to a number.
struct lb_decimal_t* lb_decimal_clone | ( | const struct lb_decimal_t * | value | ) |
Clone the decimal value
int32_t lb_decimal_cmp | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Compares the values of two Decimals.
Returns -1
if the value of this Decimal is less than the value of x
.
Returns 1
if the value of this Decimal is greater than the value of x
.
Returns 0
if the value of this Decimal equals the value of x
.
void lb_decimal_cos | ( | struct lb_decimal_t * | value | ) |
Computes the cosine of a number (in radians)
void lb_decimal_div | ( | struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Performs the /
operation.
bool lb_decimal_eq | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns true
if the value of this Decimal equals the value of x
, otherwise returns false
.
void lb_decimal_erf | ( | struct lb_decimal_t * | value | ) |
Abramowitz Approximation of Error Function from wikipedia
void lb_decimal_exp | ( | struct lb_decimal_t * | value | ) |
The estimated exponential function, ex. Stops calculating when it is within tolerance of roughly 0.0000002
.
void lb_decimal_exp_with_tolerance | ( | struct lb_decimal_t * | value, |
const struct lb_decimal_t * | tolerance | ||
) |
The estimated exponential function, ex using the tolerance
provided as a hint as to when to stop calculating. A larger tolerance will cause the number to stop calculating sooner at the potential cost of a slightly less accurate result.
void lb_decimal_floor | ( | struct lb_decimal_t * | value | ) |
Returns the largest integer less than or equal to a number.
void lb_decimal_fract | ( | struct lb_decimal_t * | value | ) |
Returns a new Decimal representing the fractional portion of the number.
void lb_decimal_free | ( | struct lb_decimal_t * | value | ) |
Free the decimal value
struct lb_decimal_t* lb_decimal_from_double | ( | double | value | ) |
Create a decimal value from double
struct lb_decimal_t* lb_decimal_from_str | ( | const char * | value | ) |
Create a decimal value from string
bool lb_decimal_gt | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns true
if the value of this Decimal is greater than the value of x
, otherwise returns false
.
bool lb_decimal_gte | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns true
if the value of this Decimal is greater than or equal to the value of x
, otherwise returns false
.
bool lb_decimal_is_negative | ( | const struct lb_decimal_t * | value | ) |
Returns true
if the decimal is negative.
bool lb_decimal_is_positive | ( | const struct lb_decimal_t * | value | ) |
Returns true
if the decimal is positive.
bool lb_decimal_is_zero | ( | const struct lb_decimal_t * | value | ) |
Returns true
if this Decimal number is equivalent to zero.
void lb_decimal_ln | ( | struct lb_decimal_t * | value | ) |
Calculates the natural logarithm for a Decimal calculated using Taylor’s series.
void lb_decimal_log10 | ( | struct lb_decimal_t * | value | ) |
Calculates the base 10 logarithm of a specified Decimal number.
bool lb_decimal_lt | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns true
if the value of this Decimal is less than the value of x
, otherwise returns false
.
bool lb_decimal_lte | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns true
if the value of this Decimal is less than or equal to the value of x
, otherwise returns false
.
const struct lb_decimal_t* lb_decimal_max | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns the maximum of the two numbers.
const struct lb_decimal_t* lb_decimal_min | ( | const struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Returns the minimum of the two numbers.
void lb_decimal_mul | ( | struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Performs the *
operation.
void lb_decimal_neg | ( | struct lb_decimal_t * | value | ) |
Performs the unary -
operation.
struct lb_decimal_t* lb_decimal_new | ( | int64_t | num, |
uint32_t | scale | ||
) |
Create a decimal value with a 64 bit m
representation and corresponding e
scale.
void lb_decimal_norm_pdf | ( | struct lb_decimal_t * | value | ) |
The Probability density function for a Normal distribution.
void lb_decimal_normal_cdf | ( | struct lb_decimal_t * | value | ) |
The Cumulative distribution function for a Normal distribution
void lb_decimal_normalize | ( | struct lb_decimal_t * | value | ) |
Strips any trailing zero’s from a Decimal and converts -0
to 0
.
void lb_decimal_pow | ( | struct lb_decimal_t * | value, |
const struct lb_decimal_t * | exp | ||
) |
Raise self to the given Decimal exponent: xy. If exp
is not whole then the approximation ey*ln(x) is used.
void lb_decimal_rem | ( | struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Performs the %
operation.
void lb_decimal_round | ( | struct lb_decimal_t * | value | ) |
Returns a new Decimal number with no fractional portion (i.e. an integer). Rounding currently follows “Bankers Rounding” rules. e.g. 6.5
-> 6
, 7.5
-> 8
void lb_decimal_round_dp | ( | struct lb_decimal_t * | value, |
uint32_t | dp | ||
) |
Returns a new Decimal number with the specified number of decimal points for fractional portion. Rounding currently follows “Bankers Rounding” rules. e.g. 6.5 -> 6, 7.5 -> 8
void lb_decimal_sin | ( | struct lb_decimal_t * | value | ) |
Computes the sine of a number (in radians)
void lb_decimal_sqrt | ( | struct lb_decimal_t * | value | ) |
The square root of a Decimal. Uses a standard Babylonian method.
void lb_decimal_sub | ( | struct lb_decimal_t * | a, |
const struct lb_decimal_t * | b | ||
) |
Performs the -
operation.
void lb_decimal_tan | ( | struct lb_decimal_t * | value | ) |
Computes the tangent of a number (in radians). Panics upon overflow or upon approaching a limit.
double lb_decimal_to_double | ( | const struct lb_decimal_t * | value | ) |
const char* lb_decimal_to_string | ( | const struct lb_decimal_t * | value | ) |
The Probability density function for a Normal distribution.
void lb_decimal_trunc | ( | struct lb_decimal_t * | value | ) |
Returns a new Decimal integral with no fractional portion. This is a true truncation whereby no rounding is performed.
int64_t lb_error_code | ( | const struct lb_error_t * | error | ) |
void lb_error_free | ( | struct lb_error_t * | error | ) |
Free the error object
const char* lb_error_message | ( | const struct lb_error_t * | error | ) |
void lb_http_client_free | ( | struct lb_http_client_t * | http_client | ) |
Free the http client
struct lb_http_client_t* lb_http_client_from_env | ( | struct lb_error_t ** | error | ) |
struct lb_http_client_t* lb_http_client_new | ( | const char * | http_url, |
const char * | app_key, | ||
const char * | app_secret, | ||
const char * | access_token | ||
) |
Create a HTTP client
void lb_http_client_request | ( | struct lb_http_client_t * | http_client, |
const char * | method, | ||
const char * | path, | ||
const struct lb_http_header_t * | headers, | ||
const char * | request_body, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Performs a HTTP request
void lb_http_result_free | ( | struct lb_http_result_t * | http_result | ) |
Free the HTTP result
const char* lb_http_result_response_body | ( | const struct lb_http_result_t * | http_result | ) |
void lb_quote_context_brokers | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security brokers
void lb_quote_context_calc_indexes | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
const enum lb_calc_index_t * | indexes, | ||
uintptr_t | num_indexes, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get calc indexes
void lb_quote_context_candlesticks | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
uintptr_t | count, | ||
enum lb_adjust_type_t | adjust_type, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security candlesticks
void lb_quote_context_capital_distribution | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get capital distribution
void lb_quote_context_capital_flow | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get capital flow intraday
void lb_quote_context_create_watchlist_group | ( | const struct lb_quote_context_t * | ctx, |
const struct lb_create_watchlist_group_t * | req, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Create watchlist group
void lb_quote_context_delete_watchlist_group | ( | const struct lb_quote_context_t * | ctx, |
int64_t | id, | ||
bool | purge, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Delete watchlist group
void lb_quote_context_depth | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security depth
void lb_quote_context_history_candlesticks_by_date | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
enum lb_adjust_type_t | adjust_type, | ||
const struct lb_date_t * | start, | ||
const struct lb_date_t * | end, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security history candlesticks by date
void lb_quote_context_history_candlesticks_by_offset | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
enum lb_adjust_type_t | adjust_type, | ||
bool | forward, | ||
const struct lb_datetime_t * | time, | ||
uintptr_t | count, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security history candlesticks by offset
void lb_quote_context_intraday | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security intraday lines
int64_t lb_quote_context_member_id | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_new | ( | const struct lb_config_t * | config, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void lb_quote_context_option_chain_expiry_date_list | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get option chain expiry date list
void lb_quote_context_option_chain_info_by_date | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
const struct lb_date_t * | expiry_date, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get option chain info by date
void lb_quote_context_option_quote | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get quote of option securities
void lb_quote_context_participants | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get participants
void lb_quote_context_quote | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get quote of securities
const char* lb_quote_context_quote_level | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_quote_package_details | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void lb_quote_context_realtime_brokers | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get real-time broker queue
Get real-time broker queue of the subscribed symbols, it always returns the data in the local storage.
void lb_quote_context_realtime_candlesticks | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
uintptr_t | count, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get real-time candlesticks
Get real-time candlesticks of the subscribed symbols, it always returns the data in the local storage.
void lb_quote_context_realtime_depth | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get real-time depth
Get real-time depth of the subscribed symbols, it always returns the data in the local storage.
void lb_quote_context_realtime_quote | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get quote of securities
Get real-time quotes of the subscribed symbols, it always returns the data in the local storage.
void lb_quote_context_realtime_trades | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
uintptr_t | count, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get real-time trades
Get real-time trades of the subscribed symbols, it always returns the data in the local storage.
uintptr_t lb_quote_context_ref_count | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_release | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_retain | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_security_list | ( | const struct lb_quote_context_t * | ctx, |
enum lb_market_t | market, | ||
enum lb_security_list_category_t | category, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security list data in the local storage.
void lb_quote_context_set_free_userdata_func | ( | const struct lb_quote_context_t * | ctx, |
lb_free_userdata_func_t | f | ||
) |
void lb_quote_context_set_on_brokers | ( | const struct lb_quote_context_t * | ctx, |
lb_brokers_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set brokers callback, after receiving the brokers data push, it will call back to this function.
void lb_quote_context_set_on_candlestick | ( | const struct lb_quote_context_t * | ctx, |
lb_candlestick_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set candlestick callback, after receiving the trades data push, it will call back to this function.
void lb_quote_context_set_on_depth | ( | const struct lb_quote_context_t * | ctx, |
lb_depth_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set depth callback, after receiving the depth data push, it will call back to this function.
void lb_quote_context_set_on_quote | ( | const struct lb_quote_context_t * | ctx, |
lb_quote_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set quote callback, after receiving the quote data push, it will call back to this function.
void lb_quote_context_set_on_trades | ( | const struct lb_quote_context_t * | ctx, |
lb_trades_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set trades callback, after receiving the trades data push, it will call back to this function.
void lb_quote_context_set_userdata | ( | const struct lb_quote_context_t * | ctx, |
void * | userdata | ||
) |
void lb_quote_context_static_info | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get basic information of securities
void lb_quote_context_subscribe | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
uint8_t | sub_types, | ||
bool | is_first_push, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void lb_quote_context_subscribe_candlesticks | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Subscribe security candlesticks
void lb_quote_context_subscrptions | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get subscription information
void lb_quote_context_trades | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
uintptr_t | count, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get security trades
void lb_quote_context_trading_days | ( | const struct lb_quote_context_t * | ctx, |
enum lb_market_t | market, | ||
const struct lb_date_t * | begin, | ||
const struct lb_date_t * | end, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get market trading days
void lb_quote_context_trading_session | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get trading session of the day
void lb_quote_context_unsubscribe | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
uint8_t | sub_types, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Unsubscribe
void lb_quote_context_unsubscribe_candlesticks | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_period_t | period, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Unsubscribe security candlesticks
void lb_quote_context_update_watchlist_group | ( | const struct lb_quote_context_t * | ctx, |
const struct lb_update_watchlist_group_t * | req, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Create watchlist group
void* lb_quote_context_userdata | ( | const struct lb_quote_context_t * | ctx | ) |
void lb_quote_context_warrant_issuers | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get warrant issuers
void lb_quote_context_warrant_list | ( | const struct lb_quote_context_t * | ctx, |
const char * | symbol, | ||
enum lb_warrant_sort_by_t | sort_by, | ||
enum lb_sort_order_type_t | sort_order, | ||
const enum lb_warrant_type_t * | warrant_type, | ||
uintptr_t | num_warrant_type, | ||
const int32_t * | issuer, | ||
uintptr_t | num_issuer, | ||
const enum lb_filter_warrant_expiry_date_t * | expiry_date, | ||
uintptr_t | num_expiry_date, | ||
const enum lb_filter_warrant_in_out_bounds_type_t * | price_type, | ||
uintptr_t | num_price_type, | ||
const enum lb_warrant_status_t * | status, | ||
uintptr_t | num_status, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Query warrant list
void lb_quote_context_warrant_quote | ( | const struct lb_quote_context_t * | ctx, |
const char *const * | symbols, | ||
uintptr_t | num_symbols, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get quote of warrant securities
void lb_quote_context_watchlist | ( | const struct lb_quote_context_t * | ctx, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get watchlist
void lb_trade_context_account_balance | ( | const struct lb_trade_context_t * | ctx, |
const char * | currency, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get account balance
void lb_trade_context_cancel_order | ( | const struct lb_trade_context_t * | ctx, |
const char * | order_id, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Cancel order
void lb_trade_context_cash_flow | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_cash_flow_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get cash flow
[in] | opts | Options for get cash flow request |
void lb_trade_context_estimate_max_purchase_quantity | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_estimate_max_purchase_quantity_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get order detail
void lb_trade_context_fund_positions | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_fund_positions_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get fund positions
[in] | opts | Options for get fund positions request |
void lb_trade_context_history_executions | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_history_executions_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get history executions
[in] | opts | Options for get histroy executions request (can be null) |
void lb_trade_context_history_orders | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_history_orders_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get history orders
[in] | opts | Options for get history orders request (can be null) |
void lb_trade_context_margin_ratio | ( | const struct lb_trade_context_t * | ctx, |
const char * | symbol, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get margin ratio
void lb_trade_context_new | ( | const struct lb_config_t * | config, |
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void lb_trade_context_order_detail | ( | const struct lb_trade_context_t * | ctx, |
const char * | order_id, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get order detail
uintptr_t lb_trade_context_ref_count | ( | const struct lb_trade_context_t * | ctx | ) |
void lb_trade_context_release | ( | const struct lb_trade_context_t * | ctx | ) |
void lb_trade_context_replace_order | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_replace_order_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Replace order
[in] | opts | Options for replace order request |
void lb_trade_context_retain | ( | const struct lb_trade_context_t * | ctx | ) |
void lb_trade_context_set_free_userdata_func | ( | const struct lb_trade_context_t * | ctx, |
lb_free_userdata_func_t | f | ||
) |
void lb_trade_context_set_on_order_changed | ( | const struct lb_trade_context_t * | ctx, |
lb_order_changed_callback_t | callback, | ||
void * | userdata, | ||
lb_free_userdata_func_t | free_userdata | ||
) |
Set order changed callback, after receiving the order changed event, it will call back to this function.
void lb_trade_context_set_userdata | ( | const struct lb_trade_context_t * | ctx, |
void * | userdata | ||
) |
void lb_trade_context_stock_positions | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_stock_positions_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get stock positions
[in] | opts | Options for get stock positions request |
void lb_trade_context_submit_order | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_submit_order_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Submit order
[in] | opts | Options for submit order request |
void lb_trade_context_subscribe | ( | const struct lb_trade_context_t * | ctx, |
const enum lb_topic_type_t * | topics, | ||
uintptr_t | num_topics, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void lb_trade_context_today_executions | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_today_executions_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get today executions
[in] | opts | Options for get today executions request (can be null) |
void lb_trade_context_today_orders | ( | const struct lb_trade_context_t * | ctx, |
const struct lb_get_today_orders_options_t * | opts, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
Get today orders
[in] | opts | Options for get today orders request (can be null) |
void lb_trade_context_unsubscribe | ( | const struct lb_trade_context_t * | ctx, |
const enum lb_topic_type_t * | topics, | ||
uintptr_t | num_topics, | ||
lb_async_callback_t | callback, | ||
void * | userdata | ||
) |
void* lb_trade_context_userdata | ( | const struct lb_trade_context_t * | ctx | ) |