algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::BarSeries Struct Reference

The bars of one instrument and interval, oldest first. More...

#include <algotradelib/src/core/market_data.hpp>

Collaboration diagram for algotradelib::BarSeries:

Public Member Functions

bool ascending () const
 Tests whether the bars are strictly ascending in time.

Public Attributes

InstrumentId instrument_
 The instrument.
BarInterval interval_ {BarInterval::ONE_DAY}
 The period each bar covers.
BarStamp stamp_ {BarStamp::CLOSE}
 Which edge of its period each bar's timestamp marks.
Currency currency_
 The currency of the prices.
bool adjusted_ {true}
 Whether the prices are adjusted for corporate actions.
std::vector< Bar > bars_
 The bars, oldest first.
std::optional< std::string > next_cursor_
 A cursor to continue from, if the broker has more.
std::chrono::system_clock::time_point received_at_
 When the series was received, on this machine's clock.

Detailed Description

The bars of one instrument and interval, oldest first.

Adapters reverse the brokers' newest-first order, so bars are ascending in time.

Definition at line 151 of file market_data.hpp.

Member Function Documentation

◆ ascending()

bool algotradelib::BarSeries::ascending ( ) const
inline

Tests whether the bars are strictly ascending in time.

Returns
true if each timestamp is later than the one before.

Definition at line 182 of file market_data.hpp.

Member Data Documentation

◆ adjusted_

bool algotradelib::BarSeries::adjusted_ {true}

Whether the prices are adjusted for corporate actions.

Definition at line 161 of file market_data.hpp.

◆ bars_

std::vector<Bar> algotradelib::BarSeries::bars_

The bars, oldest first.

There can be fewer than BarQuery::count_: paging stops on an empty page or when the page budget is spent. Use the size.

Definition at line 168 of file market_data.hpp.

Referenced by ascending(), and algotradelib::analytics::from_bars().

◆ currency_

Currency algotradelib::BarSeries::currency_

The currency of the prices.

Definition at line 159 of file market_data.hpp.

◆ instrument_

InstrumentId algotradelib::BarSeries::instrument_

The instrument.

Definition at line 153 of file market_data.hpp.

Referenced by algotradelib::analytics::from_bars().

◆ interval_

BarInterval algotradelib::BarSeries::interval_ {BarInterval::ONE_DAY}

The period each bar covers.

Definition at line 155 of file market_data.hpp.

◆ next_cursor_

std::optional<std::string> algotradelib::BarSeries::next_cursor_

A cursor to continue from, if the broker has more.

A short series may still carry one; an empty or exhausted one carries none.

Definition at line 174 of file market_data.hpp.

◆ received_at_

std::chrono::system_clock::time_point algotradelib::BarSeries::received_at_

When the series was received, on this machine's clock.

Definition at line 176 of file market_data.hpp.

◆ stamp_

BarStamp algotradelib::BarSeries::stamp_ {BarStamp::CLOSE}

Which edge of its period each bar's timestamp marks.

Definition at line 157 of file market_data.hpp.


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