Examples:
Daily: VROC(5) compares with last week's same day; VROC(20) with 1 month ago.
Monthly: VROC(12) compares with the same month last year; VROC(1) with last month.
Intraday: VROC(24) (hourly) and VROC(288) (5 minutes) for the same time yesterday.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.