pine-script

Percentage Change function in pine-script


Is there a function in pine like pct_change() in python, which can calculate percentage change in pine? Since there is not data management system


Solution

  • roc(source, length) will return 0.5 for 50%.