This is originally a script built by LazyBear in version 2 and updated to version 4. Slowly trying to learn other concepts in Pine and sharing what I come up with just in case it adds any value to the community. This gives a good idea of low volatility in the market and is a good warning sign to pay attention for a larger move when volatility swings back the other way.
Nice work, You left out "lowVol". I think you meant to use it in the bottom line as i have added it
plot(vswitch, style=plot.style_columns, color=(vswitch<lowVol)?color.red:color.gray,transp=0)
plot(vswitch, style=plot.style_columns, color=(vswitch<lowVol)?color.red:color.gray,transp=0)