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

One bar, delivered to on_bar. More...

#include <algotradelib/src/strategy/event.hpp>

Collaboration diagram for algotradelib::strategy::BarEvent:

Public Attributes

InstrumentId instrument_
 The instrument the bar is for.
BarInterval interval_ {BarInterval::ONE_DAY}
 The period length the bar covers.
BarStamp stamp_ {BarStamp::CLOSE}
 Whether bar_.timestamp_ marks the period's open or close.
Bar bar_
 The bar.
std::chrono::system_clock::time_point period_end_ {}
 When the bar's period ended: the earliest moment the bar could be known.

Detailed Description

One bar, delivered to on_bar.

interval_ and stamp_ say which period the bar covers; period_end_ is the instant that period ended, the earliest moment the bar could be known. See bar_ for which bars a live source may deliver while still forming.

Definition at line 202 of file event.hpp.

Member Data Documentation

◆ bar_

Bar algotradelib::strategy::BarEvent::bar_

The bar.

Note
Live, live::SessionSource holds back a daily or minute bar whose period has not ended, such as the broker's row for the current session. Weekly, monthly and yearly bars stamped at their open are delivered as read and may still be forming.

Definition at line 216 of file event.hpp.

Referenced by algotradelib::backtest::NextBarFillModel::decide(), algotradelib::backtest::Backtester< Strategy, CapsType >::feed(), algotradelib::runner::Runner< Strategy, CapsType, Tag, Executor >::feed(), algotradelib::runner::Runner< Strategy, CapsType, Tag, Executor >::feed_warmup(), and algotradelib::runner::Runner< Strategy, CapsType, Tag, Executor >::record().

◆ instrument_

◆ interval_

BarInterval algotradelib::strategy::BarEvent::interval_ {BarInterval::ONE_DAY}

The period length the bar covers.

Definition at line 206 of file event.hpp.

Referenced by algotradelib::backtest::ReplayClock::contiguous().

◆ period_end_

◆ stamp_

BarStamp algotradelib::strategy::BarEvent::stamp_ {BarStamp::CLOSE}

Whether bar_.timestamp_ marks the period's open or close.

Definition at line 208 of file event.hpp.


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