Код: Выделить всё
std::vector
pivothigh(const std::vector &src,
const unsigned int left,
const unsigned int right) {
const auto nan = std::numeric_limits::quiet_NaN();
const auto N = src.size();
std::vector result(N, nan);
for (auto i = left; i < N - right; i++) {
const auto val = src[i];
bool is_pivot = true;
for (auto j = i - left; j val) {
is_pivot = false;
break;
}
}
if (is_pivot) {
result[i] = val;
}
}
return result;
}
Целью приведенной выше функции является расчет максимумов колебаний серий цен на ценные бумаги (
Код: Выделить всё
srcКод: Выделить всё
lblКод: Выделить всё
lbr). Он призван соответствовать функциональности ta.pivothigh()Подробнее здесь: https://stackoverflow.com/questions/791 ... om-c-loops
Мобильная версия