OPEN-SOURCE SCRIPT
Standardized ROC Engine (EMA Version)

The purpose of this script is to create a standardized rate‑of‑change engine that compares the momentum of multiple structural anchors, specifically several EMAs, VWAP, price and volume. By converting each ROC stream into a z‑score, the indicator places all components on a common scale, allowing the trader to see when any anchor is accelerating or decelerating relative to its own long‑term distribution. This transforms raw ROC, which is naturally unstable and scale‑dependent, into a normalized momentum map that highlights extremes, clustering and regime shifts with far greater clarity.
The script works by first computing four EMAs of different lengths, along with VWAP, then calculating the percentage rate of change for each series over a user‑defined ROC window. Each ROC stream is then passed through a standardization function that subtracts its rolling mean and divides by its rolling standard deviation, producing a z‑score that expresses how unusual the current momentum is compared to the past. These standardized curves are plotted together, using consistent colors, while horizontal reference lines at one, two and three standard deviations provide visual thresholds for identifying statistically significant momentum events.
The rationale behind this architecture is that raw ROC values are not comparable across different structures because each anchor has its own volatility profile, amplitude and noise characteristics. Standardization solves this by converting every ROC stream into a dimensionless measure of deviation, enabling cross‑anchor comparison without distortion. This approach reveals when short‑term EMAs are accelerating faster than long‑term EMAs, when VWAP momentum diverges from trend momentum, and when volume expansion aligns with or contradicts price acceleration, all expressed in a unified statistical language that is robust across assets and timeframes.
The script works by first computing four EMAs of different lengths, along with VWAP, then calculating the percentage rate of change for each series over a user‑defined ROC window. Each ROC stream is then passed through a standardization function that subtracts its rolling mean and divides by its rolling standard deviation, producing a z‑score that expresses how unusual the current momentum is compared to the past. These standardized curves are plotted together, using consistent colors, while horizontal reference lines at one, two and three standard deviations provide visual thresholds for identifying statistically significant momentum events.
The rationale behind this architecture is that raw ROC values are not comparable across different structures because each anchor has its own volatility profile, amplitude and noise characteristics. Standardization solves this by converting every ROC stream into a dimensionless measure of deviation, enabling cross‑anchor comparison without distortion. This approach reveals when short‑term EMAs are accelerating faster than long‑term EMAs, when VWAP momentum diverges from trend momentum, and when volume expansion aligns with or contradicts price acceleration, all expressed in a unified statistical language that is robust across assets and timeframes.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.