WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
positionvector.c File Reference
#include <stdlib.h>
#include <string.h>
#include "wu.h"

Go to the source code of this file.

Macros

#define _POSIX_C_SOURCE   200809L

Functions

static void wu_position_vector_free (WU_PositionVector *vec)
static void add_position (WU_PositionVector *vec, WU_Position pos)
static void remove_position (WU_PositionVector *vec, int index)
static void clear_positions (WU_PositionVector *vec)
static struct WU_Position_ get_position (WU_PositionVector *vec, int index, bool *found)
static double get_total_quantity (WU_PositionVector *vec)
WU_PositionVectorwu_position_vector_new (const char *symbol)

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200809L

Definition at line 1 of file positionvector.c.

Function Documentation

◆ add_position()

void add_position ( WU_PositionVector * vec,
WU_Position pos )
static

Definition at line 9 of file positionvector.c.

◆ clear_positions()

void clear_positions ( WU_PositionVector * vec)
static

Definition at line 41 of file positionvector.c.

◆ get_position()

struct WU_Position_ get_position ( WU_PositionVector * vec,
int index,
bool * found )
static

Definition at line 49 of file positionvector.c.

◆ get_total_quantity()

double get_total_quantity ( WU_PositionVector * vec)
static

Definition at line 59 of file positionvector.c.

◆ remove_position()

void remove_position ( WU_PositionVector * vec,
int index )
static

Definition at line 34 of file positionvector.c.

◆ wu_position_vector_free()

void wu_position_vector_free ( WU_PositionVector * vec)
static

Definition at line 88 of file positionvector.c.

◆ wu_position_vector_new()

WU_PositionVector * wu_position_vector_new ( const char * symbol)

Definition at line 70 of file positionvector.c.