[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"indicator-stddev-en":3},"# Standard Deviation (STDDEV)\n\n> StratForge indicator page for rolling dispersion of the input series.\n\n**Route**: `\u002Findicators\u002Fstddev\u002F`\n\n## What It Does\n\n`stratforge::StdDev` computes the **population standard deviation** of the last `period` input values. Output has the same unit as the input price; it is not a percentage. The implementation calculates the window mean and population variance, then takes the square root.\n\n## Formula and worked example\n\n`StdDev = sqrt(sum((Price - mean)^2) \u002F period)`\n\nFor `period = 4` and prices `[2, 4, 6, 8]`, the mean is `5`, squared deviations are `[9, 1, 1, 9]`, and variance is `20 \u002F 4 = 5`. The output is `sqrt(5) ≈ 2.236` price units. A sample standard deviation would instead divide by `3`; that is **not** this indicator.\n\nThe output is unavailable until four bars exist. A one-bar window yields zero. The current implementation normalizes `period = 0` to a one-bar window; pass a positive period to make intent clear.\n\n## Parameters\n\n- `period` — rolling window size; required by the constructor.\n\n## C++23 API\n\n```cpp\n#include \u003Cstratforge\u002Findicators\u002Fstddev.hpp>\nauto stddev = std::make_unique\u003Cstratforge::StdDev>(data().close(), 20);\n```\n\nThe example assumes a StratForge strategy with `data()` available and `\u003Cmemory>` included. [Checked implementation](https:\u002F\u002Fgithub.com\u002FStratCraftsAI\u002FStratForge\u002Fblob\u002Fd25404dcf2c3842ba304ddc60ac19cfec1f8aa37\u002Finclude\u002Fstratforge\u002Findicators\u002Fstddev.hpp) (revision `d25404d`, 2026-08-28).\n\n## Common Usage\n\n- Use price-unit dispersion in volatility filters or bands.\n- To compare assets at different price levels, normalize by a defined price baseline and handle zero explicitly.\n- A larger standard deviation describes spread in this window, not future returns.\n"]