39 order_exec_check_role = 1,
40 order_exec_delay_replace = 2,
41 order_exec_fix_qty = 4,
42 order_exec_replace_send = 8
85 uint32_t max_cancel_attempts;
86 uint32_t cancel_timeout_ms;
110 void (*on_before_send)(order_t*);
118 void (*on_trade)(order_t*, xroad_trade_t*);
122 void (*on_canceled)(order_t*, xroad_rej_reason_t reason,
xroad_str_t);
126 void (*on_unexpected_canceled)(order_t*, xroad_rej_reason_t reason,
xroad_str_t);
130 void (*on_destroyed)(order_t*);
142 void (*on_cancel_rejected)(order_t*, xroad_rej_reason_t,
xroad_str_t);
146 void (*on_replace_rejected)(order_t*, xroad_rej_reason_t,
xroad_str_t);
150 void (*on_pre_trade)(order_t*, xroad_pre_trade_t*);
177 xroad_instr_t* instr,
190 uint32_t max_cancel_attempts,
191 uint32_t cancel_timeout_ms,
197 #define order_create(instr, side, callback, ...) \
199 xroad_str_t def_account = xroad_str("XXXX"); \
200 order_create_args_t args = {.account = def_account, .type = xroad_ord_type_limit, .tif = xroad_tif_day, \
202 if (args.till_date.year == 0 && args.till_date.month == 0 && args.till_date.day == 0) \
204 args.till_date = xroad_date_null; \
206 order_create_ex(instr, side, callback, args.name, args.account, args.client_code, args.type, args.qty, \
207 args.price, args.trader_book, args.flags, args.tif, args.till_date, args.max_cancel_attempts, \
208 args.cancel_timeout_ms, args.exec_flags, args.comment, args.ctx, args.err); \
250 #define order_cancel(o, ...) \
252 order_cancel_args_t args = {.send = true, ## __VA_ARGS__}; \
253 order_cancel_ex(o, args.send); \
271 #define order_replace(o, ...) \
273 xroad_qty_t def_qty = -99999; \
274 xroad_price_t def_price = -99999.0; \
275 order_replace_args_t args = (order_replace_args_t){.qty = def_qty, .price = def_price, ## __VA_ARGS__}; \
277 mask |= (args.qty == def_qty) ? 0 : order_replace_qty; \
278 mask |= !xroad_dbl_cmp(args.price, def_price) ? 0 : order_replace_price; \
279 order_replace_ex(o, args.qty, args.price, mask); \
400 void order_log_debug(order_t* o,
char* title);
order_state_t
Definition: order.h:23
@ order_state_awaiting_replace
order is in awaiting replace state
Definition: order.h:34
@ order_state_awaiting_destroy
order is in awaiting destroyed state
Definition: order.h:32
@ order_state_expired
order is in expired state
Definition: order.h:30
@ order_state_awaiting_cancel
order is in awaiting cancel state
Definition: order.h:33
@ order_state_filled
order is in filled state
Definition: order.h:29
@ order_state_destroyed
order is in destroyed state
Definition: order.h:26
@ order_state_initial
order is in initial state
Definition: order.h:24
@ order_state_canceled
order is in canceled state
Definition: order.h:27
@ order_state_rejected
order is in rejected state
Definition: order.h:28
@ order_state_active
order is in active state
Definition: order.h:25
@ order_state_awaiting_active
order is in awaiting active state
Definition: order.h:31
xroad_errno_t order_restore(order_t *o, xroad_order_t *xo)
int32_t order_get_flags(const order_t *o)
xroad_errno_t order_replace_ex(order_t *o, xroad_qty_t qty, xroad_price_t price, int32_t mask)
xroad_str_t order_get_name(const order_t *o)
xroad_qty_t order_get_replace_qty(const order_t *o)
xroad_order_t * order_get_xorder(const order_t *o)
xroad_instr_t * order_get_instr(const order_t *o)
uint64_t * order_trace_init(xroad_str_t path, size_t max_rec)
Allocates and initializes structures for orders tracing.
xroad_ord_type_t order_get_type(const order_t *o)
xroad_price_t order_get_price(const order_t *o)
xroad_qty_t order_get_qty(const order_t *o)
xroad_errno_t order_send(order_t *o)
xroad_qty_t order_get_leaves_qty(const order_t *o)
void order_reset(order_t *o)
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 trader_book, int32_t flags, xroad_tif_t tif, xroad_date_t till_date, uint32_t max_cancel_attempts, uint32_t cancel_timeout_ms, int32_t exec_flags, xroad_str_t comment, void *ctx, xroad_str_t *err)
xroad_price_t order_get_avg_price(const order_t *o)
order_state_t order_get_state(const order_t *o)
xroad_errno_t order_cancel_ex(order_t *o, bool send)
xroad_price_t order_get_replace_price(const order_t *o)
xroad_errno_t order_destroy(order_t *o, bool force)
xroad_side_t order_get_side(const order_t *o)
xroad_qty_t order_get_total_qty(const order_t *o)
xroad_errno_t order_pre_trade_ack(order_t *o, xroad_pre_trade_t *pre_trade, xroad_pre_trade_status_t status)
order_replace_mask_t
Definition: order.h:49
@ order_replace_price
replace price
Definition: order.h:51
@ order_replace_qty
replace qty
Definition: order.h:50
void * order_get_ctx(const order_t *o)
xroad_str_t order_print(const order_t *o)
xroad_str_t order_state_to_str(order_state_t state)
Definition: xroad_date.h:20
Definition: xroad_string.h:29
struct xroad_str_s xroad_str_t
see common/xroad_string.h for details
Definition: xroad_common_fwd.h:39
CAUTION: do not change this file - it is autogenerated.
xroad_ord_type_t
Definition: xroad_objects_types.h:254
int64_t xroad_qty_t
Definition: xroad_objects_types.h:159
xroad_pre_trade_status_t
Definition: xroad_objects_types.h:516