Volatility Counter
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ebanat420

//@version=5
indicator("Volatility Counter", shorttitle = "VolCount", timeframe = "", timeframe_gaps = true)
hline(2, title='Threshold lvl 2', color=color.blue, linestyle=hline.style_dotted, linewidth=2)
hline(1, title='Threshold lvl 1', color=color.rgb(255, 255, 255), linestyle=hline.style_dotted, linewidth=1)

VolVal = ( math.abs (math.max (high, low) - math.min (high, low)) / math.max (high, low) ) * 100 // This counts the volatility in a given period

plot (VolVal, "Volatility Counter", color=color.rgb(255, 0, 179))