WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
timeutils.h
Go to the documentation of this file.
1#ifndef _TIMEUTILS_H
2#define _TIMEUTILS_H
3
4#include <stdint.h>
5
6/**
7 * WU_TimeUnit represents a unit of time used for time-based calculations
8 * such as time-weighted returns or time-based aggregations.
9 */
16
17/**
18 * A timestamp represent a mark in time given relative to unix epoch.
19 * It can be expressed in seconds, millis, micros, or nanos.
20 */
21typedef struct WU_TimeStamp_ {
22 int64_t mark;
25
26/**
27 * Returns the number of units (seconds, millis, micros, or nanos)
28 * contained in a year.
29 */
31
32#endif // _TIMEUTILS_H
A timestamp represent a mark in time given relative to unix epoch.
Definition timeutils.h:21
int64_t mark
Definition timeutils.h:22
WU_TimeUnit units
Definition timeutils.h:23
WU_TimeUnit
WU_TimeUnit represents a unit of time used for time-based calculations such as time-weighted returns ...
Definition timeutils.h:10
@ WU_TIME_UNIT_SECONDS
Definition timeutils.h:11
@ WU_TIME_UNIT_NANOS
Definition timeutils.h:14
@ WU_TIME_UNIT_MILLIS
Definition timeutils.h:12
@ WU_TIME_UNIT_MICROS
Definition timeutils.h:13
double wu_annualization_factor(WU_TimeUnit unit)
Returns the number of units (seconds, millis, micros, or nanos) contained in a year.
Definition timeutils.c:3