The script was hidden due to the reference link. Republishing without any links.
If you would like to know more about the formula, just google it. The script is based on the first few results from google search.
How to use: adjust the input number and timeframe. It means how far you would like to look back. e.g. weekly timeframe and 12 as input number mean you...