![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
One instrument's bars as numeric columns: one row per bar, one column per BarField. More...
#include <algotradelib/src/analytics/frame.hpp>
Public Member Functions | |
| SeriesFrame ()=default | |
| Constructs an empty frame. | |
| SeriesFrame (TimeIndex index, InstrumentId instrument={}) | |
| Constructs a frame with one row per instant, every value missing(). | |
| std::size_t | rows () const noexcept |
| Returns the number of rows. | |
| std::size_t | columns () const noexcept |
| Returns the number of columns. | |
| const TimeIndex & | time () const noexcept |
| Returns the instants of the rows. | |
| const InstrumentId & | instrument () const noexcept |
| Returns the instrument the frame describes. | |
| math::SeriesView | column (BarField field) const |
| Returns one field's column. | |
| math::SeriesView | close () const |
| Returns the close column. | |
| math::SeriesView | open () const |
| Returns the open column. | |
| math::SeriesView | high () const |
| Returns the high column. | |
| math::SeriesView | low () const |
| Returns the low column. | |
| math::SeriesView | volume () const |
| Returns the volume column. | |
| Scalar | at (std::size_t row, BarField field) const |
| Reads one value. | |
| void | set (std::size_t row, BarField field, Scalar value) |
| Writes one value. | |
| math::MatrixView | values () const |
| Returns all values. | |
One instrument's bars as numeric columns: one row per bar, one column per BarField.
Build one with from_bars(). column() and the named accessors return views into the frame's own storage, without copying.
A field the broker did not report (an open on a day with no trade, an omitted traded value) is missing() in that row, not zero.
|
inlineexplicit |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
Returns the instrument the frame describes.
Definition at line 131 of file frame.hpp.
Referenced by SeriesFrame().
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
Writes one value.
| row | The row position. |
| field | The field. |
| value | The value to store. |
| std::out_of_range | if row is past the end. |
Definition at line 197 of file frame.hpp.
Referenced by algotradelib::analytics::from_bars().
|
inlinenoexcept |
|
inline |
Returns all values.
|
inline |