This script takes closing prices of candles to measure the Standard Deviation (σ) which is then used to calculate the volatility by taking the stdev of the last 30 candles and multiplying it by the root of the trading days in a year, month and week. It then multiplies that number by 100 to show a percentage.
Default settings are annual volatility (252 candles, red), monthly volatility (30 candles, blue) and weekly volatility (5 candles, green) if you use daily candles. It is open source so you can increase the number of candles with which the stdev is calculated, and change the number of the root that multiplies the stdev.