[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"indicator-pctchange-en":3},"# Percent Change (PCTCHANGE)\n\n> StratForge indicator page for change relative to a prior bar.\n\n**Route**: `\u002Findicators\u002Fpctchange\u002F`\n\n## What It Does\n\n`stratforge::PctChange` compares the current input with the value `period` bars earlier. Its output is a **decimal ratio**, not a number already multiplied by 100. Multiply by 100 only when displaying a percentage.\n\n## Formula and worked example\n\n`PctChange(t) = Price(t) \u002F Price(t - period) - 1`\n\nFor `period = 2`, input closes `[100, 105, 120]` produce `(120 \u002F 100) - 1 = 0.20`, displayed as `20%`. The first two bars have no value because the earlier comparison bar is unavailable. With the default `period = 30`, the first value needs 31 bars.\n\nIf the comparison price is zero, the implementation performs division without a special zero-denominator rule; the result can be non-finite. Check input data before using the value in a signal. A zero period compares the bar with itself and yields zero for nonzero prices.\n\n## Parameters\n\n- `period` — lookback offset in bars; default `30`.\n\n## C++23 API\n\n```cpp\n#include \u003Cstratforge\u002Findicators\u002Fpercentchange.hpp>\nauto pctChange = std::make_unique\u003Cstratforge::PctChange>(data().close(), 30);\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\u002Fpercentchange.hpp) (revision `d25404d`, 2026-08-28).\n\n## Common Usage\n\n- Compare changes across assets with different price scales after checking for zero and missing inputs.\n- Pair the reading with trend or volatility context; the reading alone does not establish a trading edge.\n"]