D07-F03-A10 · LEVEL 2 GUIDED LAB · SYNTHETIC DATA

Rate-of-Change Variants (ROC, ROCP, and ROCR)

How do three common scales express the same n-period price ratio? Walk the evidence clock one stage at a time. This lab teaches the publication contract; it does not simulate returns, platform parity, or trade performance.

Selected expression

ROC=100(P_t/P_(t-n)-1); ROCP=P_t/P_(t-n)-1; ROCR=P_t/P_(t-n)

Availability rule

An output at t may use only finite, basis-consistent observations available through t; chart alignment never moves the information clock backward.

calculated · step 1 of 7

Verified synthetic fixture

This lab is paired with datasets/implementation-fixtures.json: 96 deterministic, oldest-to-newest observations spanning oscillating, rising, and moderating regimes. It is teaching data—not market history or predictive evidence.

Canonical latest output (D07-F03-A10)
{
  "roc": -3.185757936162148,
  "rocp": -0.03185757936162148,
  "rocr": 0.9681424206383785
}

Executable checks cover this result, flat/zero-volume boundaries, invalid timestamps, and prefix causality in both language entry points.