WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
types.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include "timeutils.h"

Go to the source code of this file.

Data Structures

struct  WU_Signal
 WU_Signal represents a trading signal generated by a strategy. More...

Macros

#define wu_symbol_list(...)

Enumerations

enum  WU_Side { WU_SIDE_HOLD = 0 , WU_SIDE_BUY = 1 , WU_SIDE_SELL = 2 }
 WU_Side represents the direction of a signal or a trade. More...
enum  WU_DataType { WU_DATA_TYPE_CANDLE = 0 , WU_DATA_TYPE_TRADE = 1 , WU_DATA_TYPE_SINGLE_VALUE = 2 }
 WU_DataType represents the type of input data, which can be a candle, a trade, or a single value. More...
enum  WU_CloseReason { WU_CLOSE_REASON_SIGNAL = 0 , WU_CLOSE_REASON_STOP_LOSS = 1 , WU_CLOSE_REASON_TAKE_PROFIT = 2 }
 WU_CloseReason represents the reason for closing a position, which can be a trading signal, a stop loss, or a take profit. More...

Macro Definition Documentation

◆ wu_symbol_list

#define wu_symbol_list ( ...)
Value:
((const char*[]){__VA_ARGS__, NULL})

Definition at line 59 of file types.h.

Enumeration Type Documentation

◆ WU_CloseReason

WU_CloseReason represents the reason for closing a position, which can be a trading signal, a stop loss, or a take profit.

This enum is used to categorize the trades in the portfolio statistics, allowing for analysis of the performance of the strategy based on different exit reasons.

Enumerator
WU_CLOSE_REASON_SIGNAL 
WU_CLOSE_REASON_STOP_LOSS 
WU_CLOSE_REASON_TAKE_PROFIT 

Definition at line 53 of file types.h.

◆ WU_DataType

WU_DataType represents the type of input data, which can be a candle, a trade, or a single value.

All these types include a timestamp field to represent Unix times. The time scale is not fixed and can be determined by the user, e.g., it can be in seconds, milliseconds, or nanoseconds.

Enumerator
WU_DATA_TYPE_CANDLE 
WU_DATA_TYPE_TRADE 
WU_DATA_TYPE_SINGLE_VALUE 

Definition at line 24 of file types.h.

◆ WU_Side

enum WU_Side

WU_Side represents the direction of a signal or a trade.

Enumerator
WU_SIDE_HOLD 
WU_SIDE_BUY 
WU_SIDE_SELL 

Definition at line 11 of file types.h.