![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
Every instrument's bar of one interval for one period end, delivered to on_bars. More...
#include <algotradelib/src/strategy/event.hpp>
Public Member Functions | |
| const BarEvent * | find (const InstrumentId &id) const noexcept |
| Finds an instrument's bar. | |
Public Attributes | |
| std::chrono::system_clock::time_point | period_end_ {} |
| When the period ended, shared by every bar in bars_. | |
| BarInterval | interval_ {BarInterval::ONE_DAY} |
| The period length every bar in bars_ covers. | |
| std::vector< BarEvent > | bars_ |
| The bars, one per instrument, in the order they were fed. | |
Every instrument's bar of one interval for one period end, delivered to on_bars.
A runner calls on_bars once per period end and interval, after every bar of that period has been fed: cached (with a linear algebra backend, so ctx.bars(id, interval_) ends at period_end_ for each instrument here), priced and clocked. An instrument with no bar for the period is absent; there is no deadline and no placeholder. Several intervals ending at the same instant give one slice each.
The slice is valid only during the call.
|
inlinenoexcept |
| std::vector<BarEvent> algotradelib::strategy::BarSlice::bars_ |
| BarInterval algotradelib::strategy::BarSlice::interval_ {BarInterval::ONE_DAY} |
| std::chrono::system_clock::time_point algotradelib::strategy::BarSlice::period_end_ {} |