OPEN-SOURCE SCRIPT

Calmness Index [racer8]

Calmness is a theory of mine that says that the more a series of bars resembles a rectangle or base pattern, the more calm it is.
I mean think about it, when is price at it's calmest? When it's not moving of course :) And nothing better demonstrates a dead market like a base pattern. That is what makes this indicator so unique.....it's ability to detect the formation of a price base.

Calculation:
Calmness = (sum of true ranges) / (range * n periods) .............. where range = highest - lowest over n periods

The above formula reflects that the higher the Calmness value, the more calm price is.
What I would do with indicator is only trade when the previous period's calm value is higher than the set dashed level (purple line).

Colors: If market is calm, indicator is gray otherwise orange ........ Enjoy :)
OscillatorsVolatility

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer