There is an indicator described at this this web site that appears to be useful for analyzing the trendiness of the price action. http://systemtradersuccess.com/using-self-similarity-metric-intraday-data-define-market-regimes/

I tried programming it and came up with this

Y = ACC( truerange, 10) / (HIGHESTHIGH(BARS=10) - LOWESTLOW(BARS=10)); STD(Day(PERIODAMOUNT=1), y, TYPE=Percentage)

I don't think this is correct. The problem is in the second line, I am trying to find the percentile rank of the current value in the formula relative to the past year. Is there a function that finds the percentile rank?

I’ve had a look at the link you listed, and the rules on that page to see if i can build a corresponding script. Please try the following and see how you go: