tzutrader
A composable C++ backtesting library for trading strategies (experimental)
Loading...
Searching...
No Matches
tzu::Ohlcv Struct Reference

Open-High-Low-Close-Volume candlestick data. More...

#include <defs.h>

Public Member Functions

 Ohlcv (int64_t ts=0, double o=0.0, double h=0.0, double l=0.0, double c=0.0, double v=0.0)
double getFieldValue (OhlcvField field) const

Public Attributes

int64_t timestamp
 Unix timestamp for the candle.
double open
 Opening price.
double high
 Highest price during period.
double low
 Lowest price during period.
double close
 Closing price.
double volume
 Trading volume during period.

Detailed Description

Open-High-Low-Close-Volume candlestick data.

Represents aggregated trading data for a specific time period. This is the most common format for backtesting with candlestick charts.

Note
All prices are in the same currency/unit. Volume units depend on the asset being traded.

Constructor & Destructor Documentation

◆ Ohlcv()

tzu::Ohlcv::Ohlcv ( int64_t ts = 0,
double o = 0.0,
double h = 0.0,
double l = 0.0,
double c = 0.0,
double v = 0.0 )
inline

Default constructor initializes all fields to zero.

Member Function Documentation

◆ getFieldValue()

double tzu::Ohlcv::getFieldValue ( OhlcvField field) const
inline

Retrieves the value of the specified OHLCV field.

Member Data Documentation

◆ close

double tzu::Ohlcv::close

Closing price.

◆ high

double tzu::Ohlcv::high

Highest price during period.

◆ low

double tzu::Ohlcv::low

Lowest price during period.

◆ open

double tzu::Ohlcv::open

Opening price.

◆ timestamp

int64_t tzu::Ohlcv::timestamp

Unix timestamp for the candle.

◆ volume

double tzu::Ohlcv::volume

Trading volume during period.


The documentation for this struct was generated from the following file: