Percent change (rate of change) — the percent difference from periods
bars ago: (value / value[i − periods] − 1) × 100. Appends one column;
undefined for the first periods rows (no look-back) and where the prior
value is 0/missing. periods counts bars, so it's gap-correct on a
trading axis.
This is ROC. TA-Lib's ROC is the same formula, and the oracle
cross-checks this study against it: exact agreement (0.0) with identical
warm-up masks at every period tested. There is deliberately no separate
roc study — one primitive rather than two that differ invisibly. The
additive form (value − value[i − periods]) is momentum.
Percent change (rate of change) — the percent difference from
periodsbars ago:(value / value[i − periods] − 1) × 100. Appends one column;undefinedfor the firstperiodsrows (no look-back) and where the prior value is0/missing.periodscounts bars, so it's gap-correct on a trading axis.This is ROC. TA-Lib's
ROCis the same formula, and the oracle cross-checks this study against it: exact agreement (0.0) with identical warm-up masks at every period tested. There is deliberately no separaterocstudy — one primitive rather than two that differ invisibly. The additive form (value − value[i − periods]) is momentum.