|
sref< std::string > | tsa::CONST (const char *value) |
| Returns a contant series of type 'string' with given value. More...
|
|
template<typename T > |
sref< T > | tsa::CONST (T value) |
| Returns a contant series reference of given value and type T. More...
|
|
sref< bool > | tsa::CROSSES_ABOVE (const series< double > &a, const series< double > &b) |
| Returns true if series a crosses above series b. More...
|
|
sref< bool > | tsa::CROSSES_BELOW (const series< double > &a, const series< double > &b) |
| Returns true if series a crosses below series b. More...
|
|
template<typename T > |
sref< T > | tsa::GET (T &arg_ref) |
| Translates the scalar value referred to by arg_ref (normally referring to a strategy member) into a DSL series for use in DLS. Use this GET() function in conjunction with SET() to interact with non-DSL variables. More...
|
|
template<typename T > |
scalar_assigner< T > | tsa::SET (T &var_ref) |
|
template<typename T > |
sref< T > | tsa::SHIFT (const series< T > &series, size_t shift_by) |
| Shifts the series by shift_by positions. This is the equivalent of using series<T>::operator(). More...
|
|
template<typename T > |
sref< T > | tsa::SHIFT (const sref< T > &series, size_t shift_by) |
| Shifts the series by shift_by positions. This is the equivalent of using series_cref<T>::operator(). More...
|
|
template<typename T > |
sref< T > | tsa::TRANSFORM_SERIES (sref< T > data, size_t period, const std::function< T(const T *, size_t)> &transform_function) |
| Returns a transformation of the values in data over the given period, by applying transform_function, which is usually a lambda function. The pointer to the front of data, together with period are passed as argument to the transform_function. More...
|
|
template<typename T0 , typename T1 > |
sref< T0 > | tsa::TRANSFORM_SERIES (sref< T0 > data0, sref< T1 > data1, size_t period, const std::function< T0(const T0 *, const T1 *, size_t)> &transform_function) |
| Returns a transformation of the values in data0 and data1 over the given period, by applying transform_function, which is usually a lambda function. The pointer to the front of data0 and data1, together with period are passed as argument to the transform_function, which is usually a lambda function. The following code calculates a sum over a dynamic period. More...
|
|
sref< bool > | tsa::X_ABOVE (const series< double > &a, const series< double > &b) |
| alias for CROSSES_ABOVE.
|
|
sref< bool > | tsa::X_BELOW (const series< double > &a, const series< double > &b) |
| alias for CROSSES_bELOW.
|
|
template<typename T0 , typename T1 >
sref<T0> tsa::TRANSFORM_SERIES |
( |
sref< T0 > |
data0, |
|
|
sref< T1 > |
data1, |
|
|
size_t |
period, |
|
|
const std::function< T0(const T0 *, const T1 *, size_t)> & |
transform_function |
|
) |
| |
Returns a transformation of the values in data0 and data1 over the given period, by applying transform_function, which is usually a lambda function. The pointer to the front of data0 and data1, together with period are passed as argument to the transform_function, which is usually a lambda function. The following code calculates a sum over a dynamic period.
auto dyn_sum = TRANSFORM_SERIES<double, size_t>(mkt.close, dyn_period, 20,
[](const double* data, const size_t* dyn_period, size_t max_period)
{
double sum = 0.0;
size_t adj_period = dyn_period[0];
if (adj_period == 0)
adj_period = 1;
if (adj_period > max_period)
adj_period = max_period;
for (size_t c = 0; c<adj_period; c++) {
sum += data[c];
}
return sum;
})
.
- Template Parameters
-
T0 | Template arg 1. |
T1 | Template arg 2. |
- Parameters
-
data0 | The data0. |
data1 | The data1. |
period | The period. |
transform_function | The transform function. |
- Returns
- A sref<T0>