8#define WU_SYMBOL_MAX_LEN 32
40#define wu_position_add(vec, pos) ((vec)->add((vec), (pos)))
41#define wu_position_remove(vec, index) ((vec)->remove((vec), (index)))
42#define wu_position_clear(vec) ((vec)->clear((vec)))
43#define wu_position_get(vec, index, found) ((vec)->get((vec), (index), (found)))
44#define wu_position_total_quantity(vec) ((vec)->total_quantity((vec)))
45#define wu_position_vector_delete(vec) do { \
47 (vec)->delete((WU_PositionVector*)(vec)); \
WU_PositionVector * wu_position_vector_new(const char *symbol)
WU_PositionSizeType
WU_PositionSizeType represents the type of position sizing used in the portfolio.
@ WU_POSITION_SIZE_PCT_EQUAL
@ WU_POSITION_SIZE_STRATEGY_GUIDED
WU_PositionSizeType size_type
WU_PositionVector is a data structure that holds multiple positions for a single asset.
struct WU_Position_(* get)(struct WU_PositionVector *vec, int index, bool *found)
void(* remove)(struct WU_PositionVector *vec, int index)
struct WU_Position_ * positions
void(* clear)(struct WU_PositionVector *vec)
double(* total_quantity)(struct WU_PositionVector *vec)
void(* add)(struct WU_PositionVector *vec, WU_Position pos)
WU_Position represents an open position in the portfolio.
A timestamp represent a mark in time given relative to unix epoch.