In the stock market if prices move away from the average with a too high are suspect. This principle is embodied in the Chauvenet floor with the definition of two asymptotes and two data areas rejection.
The Chauvenet Radius is the quadratic sum of the delta (distance from average) and sigmoid ( ) and is therefore an obvious market stability index. In fact the moments when price strongly moves away from the average with high coincide with the moments of high instability of the market.
It can be considered an evolution of John method introduced during the '80.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.
//@version=2 study("Chauvenet Radius",shorttitle="Chavrad",overlay=false) len=input(defval=20,minval=1) price=close avg=sma(price,len) x=price-avg y=stdev(price,len) rad=pow(x+y,2) ema=ema(rad,10) hist1=rad-ema hist2=ema-rad histpos=hist1<0?0:hist1 histneg=hist2<0?0:hist2 plot(rad,color=lime,transp=80) plot(ema,color=red,transp=80) plot(histpos,style=columns,color=green) plot(histneg,style=columns,color=maroon)