#include "order_fwd.h"#include <common/xroad_string.h>#include <common/xroad_date.h>#include <cache/xroad_objects.h>#include <logger/xroad_logger.h>#include <stdbool.h>#include <float.h>

Go to the source code of this file.
Classes | |
| struct | order_replace_args_t |
| struct | order_create_args_t |
| struct | order_cancel_args_t |
| struct | order_callback_t |
| struct | order_trace_corr_s |
| Correlation information for tracing. More... | |
Macros | |
| #define | order_create(instr, side, callback, ...) |
| #define | order_cancel(o, ...) |
| #define | order_replace(o, ...) |
Typedefs | |
| typedef struct order_trace_corr_s | order_trace_corr_t |
Enumerations | |
| enum | order_state_t { order_state_initial = 0 , order_state_active = 1 , order_state_destroyed = 2 , order_state_canceled = 3 , order_state_rejected = 4 , order_state_filled = 5 , order_state_expired = 6 , order_state_awaiting_active = 7 , order_state_awaiting_destroy = 8 , order_state_awaiting_cancel = 9 , order_state_awaiting_replace = 10 , order_state_awaiting_cancel_replace = 11 , order_state_awaiting_suspend = 12 , order_state_suspended = 13 , order_state_resend = 14 , order_state_awaiting_cancel_resend = 15 } |
| enum | order_exec_t { order_exec_check_role = 1 , order_exec_fix_qty = 2 , order_exec_replace_send = 4 } |
| enum | order_replace_mask_t { order_replace_qty = 1 , order_replace_price = 2 , order_replace_cancel_attempts = 4 , order_replace_cancel_timeout_us = 8 , order_replace_resend_attempts = 16 , order_replace_resend_timeout_us = 32 } |
| enum | { order_bad_corr_id = ~0ul } |
Functions | |
| xroad_str_t | order_state_to_str (order_state_t state) |
| order_t * | order_create_ex (xroad_instr_t *instr, xroad_side_t side, order_callback_t callback, xroad_str_t name, xroad_str_t account, xroad_str_t client_code, xroad_ord_type_t type, xroad_qty_t qty, xroad_price_t price, xroad_str_t ext_ref, int32_t flags, xroad_tif_t tif, xroad_date_t till_date, uint32_t cancel_attempts, uint64_t cancel_timeout_us, int32_t exec_flags, xroad_str_t comment, void *ctx, xroad_logger_t *logger, uint32_t resend_attempts, uint64_t resend_timeout_us, xroad_str_t sender, xroad_str_t *err, xroad_portfolio_t *portfolio, xroad_broker_t *broker, xroad_currency_t *hedge_cur) |
| xroad_errno_t | order_destroy (order_t *o, bool force) |
| xroad_errno_t | order_send (order_t *o) |
| xroad_errno_t | order_cancel_ex (order_t *o, bool send) |
| xroad_errno_t | order_pre_trade_ack (order_t *o, xroad_pre_trade_t *pre_trade, xroad_pre_trade_status_t status) |
| xroad_errno_t | order_replace_ex (order_t *o, order_replace_args_t args) |
| void | order_reset (order_t *o) |
| xroad_str_t | order_get_name (const order_t *o) |
| xroad_instr_t * | order_get_instr (const order_t *o) |
| xroad_side_t | order_get_side (const order_t *o) |
| xroad_qty_t | order_get_qty (const order_t *o) |
| xroad_qty_t | order_get_leaves_qty (const order_t *o) |
| xroad_price_t | order_get_price (const order_t *o) |
| xroad_price_t | order_get_replace_price (const order_t *o) |
| xroad_qty_t | order_get_replace_qty (const order_t *o) |
| void * | order_get_ctx (const order_t *o) |
| order_state_t | order_get_state (const order_t *o) |
| xroad_qty_t | order_get_total_qty (const order_t *o) |
| xroad_price_t | order_get_avg_price (const order_t *o) |
| xroad_ord_type_t | order_get_type (const order_t *o) |
| xroad_str_t | order_print (const order_t *o) |
| xroad_order_t * | order_get_xorder (const order_t *o) |
| int32_t | order_get_flags (const order_t *o) |
| void | order_log_debug (order_t *o, char *title) |
| order_trace_corr_t * | order_trace_init (xroad_str_t path, size_t max_rec) |
| Allocates and initializes structures for orders tracing. More... | |
| #define order_cancel | ( | o, | |
| ... | |||
| ) |
| #define order_create | ( | instr, | |
| side, | |||
| callback, | |||
| ... | |||
| ) |
| #define order_replace | ( | o, | |
| ... | |||
| ) |
| enum order_replace_mask_t |
replace mask
| enum order_state_t |
order state
| xroad_errno_t order_cancel_ex | ( | order_t * | o, |
| bool | send | ||
| ) |
cancel order. order will be cancelled
| [in] | o | - order to cancel |
| [in] | send | - if - true, cancel will be send to exchange, else just switch order to awaiting_cancel state |
| order_t* order_create_ex | ( | xroad_instr_t * | instr, |
| xroad_side_t | side, | ||
| order_callback_t | callback, | ||
| xroad_str_t | name, | ||
| xroad_str_t | account, | ||
| xroad_str_t | client_code, | ||
| xroad_ord_type_t | type, | ||
| xroad_qty_t | qty, | ||
| xroad_price_t | price, | ||
| xroad_str_t | ext_ref, | ||
| int32_t | flags, | ||
| xroad_tif_t | tif, | ||
| xroad_date_t | till_date, | ||
| uint32_t | cancel_attempts, | ||
| uint64_t | cancel_timeout_us, | ||
| int32_t | exec_flags, | ||
| xroad_str_t | comment, | ||
| void * | ctx, | ||
| xroad_logger_t * | logger, | ||
| uint32_t | resend_attempts, | ||
| uint64_t | resend_timeout_us, | ||
| xroad_str_t | sender, | ||
| xroad_str_t * | err, | ||
| xroad_portfolio_t * | portfolio, | ||
| xroad_broker_t * | broker, | ||
| xroad_currency_t * | hedge_cur | ||
| ) |
create new order
| [in] | instr | - instrument |
| [in] | side | - order side |
| [in] | callback | - order callback |
| [in] | name | - order name. Must be unique. Can be null, in this case name will be autogenerated |
| [in] | account | - order account |
| [in] | client_code | - order client_code |
| [in] | type | - order type, limit/market |
| [in] | qty | - order qty |
| [in] | price | - order price |
| [in] | ext_ref | - order ext_ref |
| [in] | flags | - order flags (see xroad_order_flags_t for details) |
| [in] | tif | - order time-in-force |
| [in] | till_date | - till date (for GTD only) |
| [in] | max_cancel_attempts | - max cancel attempts |
| [in] | cancel_timeout_us | - cancel timeout in microseconds |
| [in] | exec_flags | - order exec flags, changed behaviour (see order_exec_t) |
| [in] | comment | - order comment, which will be sent with order |
| [in] | ctx | - order ctx |
| [in] | logger | - logger |
| [in] | resend_attempts | - resend/replace order on error attempts |
| [in] | resend_timeout_us | - resend timeout in microseconds |
| [in] | sender | - order sender |
| [out] | err | - error description is any |
| [in] | portfolio | - order portfolio |
| [in] | broker | - order broker |
| [in] | hedge_cur | - order hedge currency |
| xroad_errno_t order_destroy | ( | order_t * | o, |
| bool | force | ||
| ) |
destroy order
| [in] | o | - order to destory |
| [in] | force | - force order destruction (don't wait for exchange ack, if any) |
| xroad_price_t order_get_avg_price | ( | const order_t * | o | ) |
get order avg price
| [in] | o | - order |
| void* order_get_ctx | ( | const order_t * | o | ) |
get order context
| [in] | o | - order |
| int32_t order_get_flags | ( | const order_t * | o | ) |
get order flags
| [in] | o | - order |
| xroad_instr_t* order_get_instr | ( | const order_t * | o | ) |
get order instrument
| [in] | o | - order |
| xroad_qty_t order_get_leaves_qty | ( | const order_t * | o | ) |
get order leaves qty
| [in] | o | - order |
| xroad_str_t order_get_name | ( | const order_t * | o | ) |
get order name
| [in] | o | - order |
| xroad_price_t order_get_price | ( | const order_t * | o | ) |
get order price
| [in] | o | - order |
| xroad_qty_t order_get_qty | ( | const order_t * | o | ) |
get order qty
| [in] | o | - order |
| xroad_price_t order_get_replace_price | ( | const order_t * | o | ) |
get order pending price (replace)
| [in] | o | - order |
| xroad_qty_t order_get_replace_qty | ( | const order_t * | o | ) |
get order pending qty (replace)
| [in] | o | - order |
| xroad_side_t order_get_side | ( | const order_t * | o | ) |
get order side
| [in] | o | - order |
| order_state_t order_get_state | ( | const order_t * | o | ) |
get order state
| [in] | o | - order |
| xroad_qty_t order_get_total_qty | ( | const order_t * | o | ) |
get order total qty
| [in] | o | - order |
| xroad_ord_type_t order_get_type | ( | const order_t * | o | ) |
get order type
| [in] | o | - order |
| xroad_order_t* order_get_xorder | ( | const order_t * | o | ) |
return xroad_order_t* pointer, if any
| [in] | o | - pointer to order return xroad_order_t* pointer if any |
| xroad_errno_t order_pre_trade_ack | ( | order_t * | o, |
| xroad_pre_trade_t * | pre_trade, | ||
| xroad_pre_trade_status_t | status | ||
| ) |
| [in] | o | - order |
| [in] | pre_trade | - pre_trade |
| [in] | status | - if - xroad_pre_trade_status_accept, accept, else reject |
| xroad_str_t order_print | ( | const order_t * | o | ) |
print order
| [in] | o | - order to print |
| xroad_errno_t order_replace_ex | ( | order_t * | o, |
| order_replace_args_t | args | ||
| ) |
replace order
| [in] | o | - order to replace |
| [in] | args | - order replaced fields (see order_replace_args_t for details) |
| void order_reset | ( | order_t * | o | ) |
reset order statistic
| [in] | o | - order to reset |
| xroad_errno_t order_send | ( | order_t * | o | ) |
send order. order will be send to exchange
| [in] | o | - order to send |
| xroad_str_t order_state_to_str | ( | order_state_t | state | ) |
convert order state to string representation
| [in] | state | - order state |
| order_trace_corr_t* order_trace_init | ( | xroad_str_t | path, |
| size_t | max_rec | ||
| ) |
Allocates and initializes structures for orders tracing.
| path | memory-mapped file path |
| max_rec | maximum number of records to be written |