![]() |
algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
|
The numeric vocabulary: Scalar, missing(), and the matrix and vector types. More...
Classes | |
| struct | Observed |
| A series split into zero-filled values and a presence mask, for sums that skip gaps. More... | |
Typedefs | |
| using | Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> |
| A dense, column-major matrix of Scalar. | |
| using | Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1> |
| A dense column vector of Scalar. | |
| using | SeriesView = Eigen::Ref<const Vector> |
| A read-only reference to one series. | |
| using | MutableSeriesView = Eigen::Ref<Vector> |
| A writable reference to one series, such as a Vector or a column of a Matrix. | |
| using | MatrixView = Eigen::Ref<const Matrix> |
| A read-only reference to a whole matrix. | |
| using | Index = Eigen::Index |
| The signed index type of rows and columns. | |
| using | Scalar = double |
| The floating-point type the analytics and math layers compute in (double). | |
Functions | |
| Vector | unobserved (std::size_t count) |
| Makes a vector filled with missing(). | |
| Matrix | unobserved (std::size_t rows, std::size_t columns) |
| Makes a matrix filled with missing(). | |
| Observed | observed_parts (SeriesView values) |
| Splits a series into zero-filled values and a presence mask. | |
| Scalar | missing () |
| Returns the value that stands for "no observation" (a quiet NaN). | |
| bool | observed (Scalar value) |
| Tests whether a value is an observation. | |
| Scalar | undefined () |
| Returns the value that stands for "the data was there, but the statistic does not exist". | |
| bool | is_undefined (Scalar value) |
| Tests whether a value is the undefined() marker. | |
| using algotradelib::math::Index = Eigen::Index |
| using algotradelib::math::Matrix = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> |
A dense, column-major matrix of Scalar.
Frames put time on the rows and one series per column, so a column binds to SeriesView without a copy.
| using algotradelib::math::MatrixView = Eigen::Ref<const Matrix> |
| using algotradelib::math::MutableSeriesView = Eigen::Ref<Vector> |
| using algotradelib::math::Scalar = double |
The floating-point type the analytics and math layers compute in (double).
Prices, quantities and money in orders and broker data stay Decimal64; convert between the two with the functions in analytics/conversion.hpp.
Definition at line 18 of file scalar.hpp.
| using algotradelib::math::SeriesView = Eigen::Ref<const Vector> |
| using algotradelib::math::Vector = Eigen::Matrix<Scalar, Eigen::Dynamic, 1> |
|
inline |
Tests whether a value is the undefined() marker.
| value | The value to test. |
Definition at line 73 of file scalar.hpp.
Referenced by is_undefined().
|
inline |
Returns the value that stands for "no observation" (a quiet NaN).
Used for an indicator's warm-up rows, a gap in a panel, or a field a broker did not report. Every reduction in the analytics layer skips it.
Definition at line 28 of file scalar.hpp.
Referenced by algotradelib::backtest::chain_results(), algotradelib::backtest::measure_input(), missing(), algotradelib::analytics::SeriesBuffer::push(), unobserved(), and unobserved().
|
inline |
Tests whether a value is an observation.
| value | The value to test. |
Definition at line 38 of file scalar.hpp.
Referenced by observed().
|
inline |
Splits a series into zero-filled values and a presence mask.
| values | The series; any NaN counts as unobserved. |
Definition at line 95 of file eigen.hpp.
Referenced by observed_parts().
|
inline |
Returns the value that stands for "the data was there, but the statistic does not exist".
Examples: a z-score over a window with no dispersion, a Sortino ratio over a series that never fell below its target. It differs from missing(), which means there was no data. Both are quiet NaNs, so observed() is false for both and reductions skip both; only is_undefined() tells them apart.
Definition at line 55 of file scalar.hpp.
Referenced by algotradelib::analytics::max_drawdown(), and undefined().
|
inline |
Makes a vector filled with missing().
| count | The number of entries. |
Definition at line 55 of file eigen.hpp.
Referenced by algotradelib::analytics::SeriesBuffer::SeriesBuffer(), unobserved(), and unobserved().