The “Choppiness index” is an indicator made for detecting if the market is in ranging situation or trending.
The indicator is bounded between 1 and 100 and must be read inverted of the price : the higher the value, the higher probability that the market is ranging. If the choppiness index is evolving below the 38.2, we can consider that the market is trending, if its value is superior to 61.2 then the price is moving sideways.
// parameters:
// n=14
choppinexindex = 100 * LOG( SUMMATION[n](averagetruerange[1]) / ( Highest[n](high) - Lowest[n](low) ) ) / LOG(n)
RETURN choppinexindex