Measures the volatility range of current price range, can help detect squeezes as well explosive moves (description from original author: ricardo santos)
//PRC_VolatilityExplosiveMeasure | indicator
//14.03.2022
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from pinescript
bulloutput = 0
bearoutput = 0
irange = close - open
doji = irange = 0
upbar = irange > 0 or doji and irange[1] > 0
bullcounter = barssince(not upbar)
if (upbar) then
for i = 0 to max(0, bullcounter - 1)
bulloutput = bulloutput + irange[i]
next
endif
dnbar = irange < 0 or doji and irange[1] < 0
bearcounter = barssince(not dnbar)
if (dnbar) then
for i = 0 to max(0, bearcounter - 1)
bearoutput = bearoutput + irange[i]
next
endif
length = 10
bullma = average[length,1](bulloutput)
bearma = average[length,1](bearoutput)
width = bullma - bearma
return width