'roc() is not working in pine script version 5

I'm new to Pine script, though i'm trying to write a script to list the High beta stocks in "NIFTY". Someone could help me to find a way to use ROC in Pine script V5, i was trying to use the script from one of the trader online, but now its outdated version. i tried to figure out few functions like study as indicator() security as request.security and so on.

i'm getting below error while using '''roc(ast, 1)''' here ast is one of the requested security.

" line 11: Could not find function or function reference 'roc'."

Although there are few websites which will give lists so easily i just want to learn this pine script.

Thanks in advance!



Solution 1:[1]

In v5, the roc() function has been renamed to ta.roc(), along with many other built-in functions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 beeholder