[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"indicator-weightedaverage-zh-tw":3},"# Weighted Average (WEIGHTEDAVERAGE)\n\n> StratCraft indicator page for a coefficient-weighted rolling average.\n\n**Route**: `\u002Findicators\u002Fweightedaverage\u002F`\n\n## What It Does\n\nWEIGHTEDAVERAGE computes a rolling average with an adjustable coefficient and weight structure.\n\n## Formula\n\n`Weighted Average = weighted sum of prices over the lookback window`\n\n## Parameters\n\n- `period` - default `14`\n- `coef` - default `1`\n- `weights` - default `()`\n\n## C++23 API\n\n```cpp\n#include \u003Cnonabt\u002Findicators\u002Fweightedaverage.hpp>\nauto weightedAverage = std::make_unique\u003Cnonabt::WEIGHTEDAVERAGE>(data().close(), 14, 1, \"()\");\n```\n\n## Common Usage\n\n- Use it when different parts of the window should contribute unevenly.\n- Pair it with price crossovers or smoothing workflows.\n- Helpful for custom weighting schemes in strategy templates.\n"]