Weighted Average (WEIGHTEDAVERAGE)
QuantNexus indicator page for a coefficient-weighted rolling average.
Route: /quantnexus/indicators/weightedaverage/
What It Does
WEIGHTEDAVERAGE computes a rolling average with an adjustable coefficient and weight structure.
Formula
Weighted Average = weighted sum of prices over the lookback window
Parameters
period- default14coef- default1weights- default()
C++23 API
#include <nonabt/indicators/weightedaverage.hpp>
auto weightedAverage = std::make_unique<nonabt::WEIGHTEDAVERAGE>(data().close(), 14, 1, "()");
Common Usage
- Use it when different parts of the window should contribute unevenly.
- Pair it with price crossovers or smoothing workflows.
- Helpful for custom weighting schemes in strategy templates.
