XROAD
algo_order.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <common/xroad_string.h>
9 #include <cache/xroad_objects.h>
11 #include <algo/curr_engine/curr_engine.h>
12 
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17 
18 typedef struct algo_order_s algo_order_t;
19 
23 typedef enum
24 {
34 
38 typedef struct
39 {
43  void (*on_accepted)(void*, xroad_order_t*);
47  void (*on_trade)(void*, xroad_order_t*, xroad_trade_t*);
51  void (*on_canceled)(void*, xroad_order_t*, xroad_canceled_t*);
55  void (*on_unexpected_canceled)(void*, xroad_order_t*, xroad_canceled_t*);
59  void (*on_expired)(void*, xroad_order_t*);
63  void (*on_replaced)(void*, xroad_order_t*, xroad_replaced_t*);
67  void (*on_rejected)(void*, xroad_order_t*, xroad_rejected_t*);
71  void (*on_cancel_rejected)(void*, xroad_order_t*, xroad_cancel_rejected_t* cr);
75  void (*on_replace_rejected)(void*, xroad_order_t*);
76 
78 
89 algo_order_t* algo_order_create(
90  mdata_engine_t* mdata,
91  algo_order_callback_t callback,
92  xroad_order_t* parent,
93  curr_engine_t* ce,
94  void* ctx,
95  int64_t level_interval);
96 
103 void algo_order_destroy(algo_order_t* o);
104 
105 void algo_order_stop(algo_order_t* o);
111 xroad_errno_t algo_order_cancel(algo_order_t* o);
112 
121 xroad_errno_t algo_order_send(algo_order_t* o, xroad_qty_t qty, xroad_qty_t display_qty, int64_t mid_shift, int64_t liq_shift, int64_t agression_level, int32_t pool_size);
122 
133 xroad_errno_t algo_order_send_ex(algo_order_t* o, xroad_qty_t qty, xroad_qty_t display_qty, int64_t mid_shift, int64_t liq_shift, int64_t agression_level, int32_t sensitivity, int32_t deviation, xroad_qty_t threshold_qty, int32_t pool_size);
139 void algo_order_on_node_object(algo_order_t* order, void* obj);
140 
145 void* algo_order_get_ctx(algo_order_t* order);
146 
152 
158 
164 void algo_order_set_state(algo_order_t* o, algo_order_state_t s);
165 
170 xroad_str_t algo_order_stat(algo_order_t* o);
171 
176 xroad_order_t* algo_order_get_parent(algo_order_t* order);
177 
183 int32_t algo_order_exceed_limit(algo_order_t*, xroad_price_t);
184 
185 xroad_errno_t algo_order_get_limit(algo_order_t* ao, xroad_price_t* p);
186 
187 xroad_price_t algo_order_get_rate(algo_order_t* ao);
188 
189 #ifdef __cplusplus
190 }
191 #endif
algo_order_state_t algo_order_get_state(algo_order_t *)
algo_order_state_t
Definition: algo_order.h:24
@ algo_order_state_initial
order is in initial state
Definition: algo_order.h:25
@ algo_order_state_active
order is in active state
Definition: algo_order.h:26
@ algo_order_state_awaiting_replace
order is in awaiting replace state
Definition: algo_order.h:32
@ algo_order_state_awaiting_cancel
order is in awaiting cancel state
Definition: algo_order.h:30
@ algo_order_state_liquidate
order is in liquidation state
Definition: algo_order.h:28
@ algo_order_state_canceled
order is in canceled state
Definition: algo_order.h:31
@ algo_order_state_middle
order is in midle state
Definition: algo_order.h:27
@ algo_order_state_completed
order is in completed state
Definition: algo_order.h:29
xroad_str_t algo_order_stat(algo_order_t *o)
void * algo_order_get_ctx(algo_order_t *order)
xroad_errno_t algo_order_cancel(algo_order_t *o)
algo_order_t * algo_order_create(mdata_engine_t *mdata, algo_order_callback_t callback, xroad_order_t *parent, curr_engine_t *ce, void *ctx, int64_t level_interval)
void algo_order_on_node_object(algo_order_t *order, void *obj)
xroad_errno_t algo_order_send_ex(algo_order_t *o, xroad_qty_t qty, xroad_qty_t display_qty, int64_t mid_shift, int64_t liq_shift, int64_t agression_level, int32_t sensitivity, int32_t deviation, xroad_qty_t threshold_qty, int32_t pool_size)
int32_t algo_order_exceed_limit(algo_order_t *, xroad_price_t)
xroad_order_t * algo_order_get_parent(algo_order_t *order)
void algo_order_set_state(algo_order_t *o, algo_order_state_t s)
void algo_order_destroy(algo_order_t *o)
xroad_errno_t algo_order_send(algo_order_t *o, xroad_qty_t qty, xroad_qty_t display_qty, int64_t mid_shift, int64_t liq_shift, int64_t agression_level, int32_t pool_size)
xroad_qty_t algo_order_get_qty(algo_order_t *)
Definition: algo_order.h:39
Definition: xroad_string.h:29
CAUTION: do not change this file - it is autogenerated.
int64_t xroad_qty_t
Definition: xroad_objects_types.h:159